this stack threadの後にグリッドでダブルクリックイベントをキャプチャしました。興味深いことに、私のグリッドは、もはやそのチェックボックス ui-gridにカスタム行テンプレートを追加しましたが、行のハイライト機能が失われました
下のGIFに概説されているようのは、私が行テンプレートを追加する前に 以下のgifで見られるように、すべてが、大丈夫だったし、正しく働いていた、選択された行を強調表示しません
コントローラー:
function rowTemplate() {
return '<div ng-dblclick="grid.appScope.rowDblClick(row)" >' +
' <div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.uid" ui-grid-one-bind-id-grid="rowRenderIndex + \'-\' + col.uid + \'-cell\'" class="ui-grid-cell" ng-class="{ \'ui-grid-row-header-cell\': col.isRowHeader }" role="{{col.isRowHeader ? \'rowheader\' : \'gridcell\'}}" ui-grid-cell></div>' +
'</div>';
}
は、行テンプレートコードは:
, rowTemplate: rowTemplate()
UPDATE
$scope.rowDblClick = function(row) {
console.log('double click event');
var thisRow = gridApi.selection.getSelectedRows() //gets the clicked row object
$log.log(thisRow);
$('.item').on('click', function(){
//if user clicks on grid tab, should go to grid view else go to patient view
if ($(this).hasClass('not')){
console.log('item has .not')
$state.go('list.patient.patient-information');
} else {
console.log('item has .grid')
$state.go('list.grid');
}
//
$('.item').css('cssText', 'border-radius: 0px !important; background-color: #4B6A89; font-family: Roboto; font-size: 14px; color: white; font-weight: bold; letter-spacing: 1.5px; text-transform: uppercase;')
$(this).closest('.item').css('cssText', 'border-radius: 0px !important; color: #4B6A89; background-color: white; font-family: Roboto; font-size: 14px; color: #4B6A89; font-weight: bold; letter-spacing: 1.5px; text-transform: uppercase;');
});
//after a 2click, deselect the row, so a user can edit another cell
$scope.gridApi.selection.clearSelectedRows();
};
$scope.gridOptions
内側:私はテンプレートから<div ng-dblclick="grid.appScope.rowDblClick(row)" >
を削除すると、ラインのハイライトは、私は、ダブルクリックの機能を失うものの
実例を提供できますか? https://jsbin.comまたは何か? – Saram