我一直在尝试使用自定义单元格模板在Jquery Datepicker
UI网格中添加Angularjs
。
当我从date
中选择Jquery date picker
时,UI-Grid
完成加载后,JQuery date picker
功能对于相应的单元格不起作用。
我试图强行删除自定义目录中的DOM元素,但没有运气。
$scope.editableCellTemplateFrom = '<div ui-grid-editor><form name="inputForm" ><input type="text" readonly data-ng-model="row.entity.validFrom" extdatepicker /></form></div>' ;
customdirectives.directive('extdatepicker', function (uiGridConstants,$timeout) {
return{
restrict: 'A',
link: function(scope, element, attrs, Ctrl) {
element.datepicker({
dateFormat: 'dd/mm/yy',
changeMonth: true,
changeYear: true,
onSelect: function(d,i){
$timeout(function(){
scope.row.isDirty = true;
scope.row.entity.validFrom = d;
element.parent().parent().removeAttr("aria-selected");
element.parent().parent().find('div').removeClass("ui-grid-cell-contents-hidden ui-grid-cell-focus");
element.parent().remove();
//scope.row.grid.api.rowEdit.setRowsDirty([scope.row.entity]);
if (!scope.row.grid.api.rowEdit.dirtyRows ){
scope.row.grid.api.rowEdit.dirtyRows = [];
}
scope.row.grid.api.rowEdit.dirtyRows.push(scope.row.entity);
//scope.row.grid.api.edit.raise.afterCellEdit(scope.row.entity, scope.col.colDef);
scope.row.grid.api.edit.raise.cancelCellEdit(scope.row.entity, scope.col.colDef);
//scope.row.grid.api.edit.raise.cancelCellEdit(scope.row.entity, scope.col.colDef);
//scope.row.grid.api.core.notifyDataChange(uiGridConstants.dataChange.EDIT);
//scope.row.grid.api.core.notifyDataChange( uiGridConstants.dataChange.COLUMN );
scope.row.grid.api.core.raise.columnVisibilityChanged( scope.col);
scope.$apply();
scope.row.grid.api.core.refresh();
//endEdit
},1000);
}
});
}
}
});
ui-grid
在JQuery date pciker
加载了cell-grid
后,如何启用/刷新v1.2.3
功能。
使用的版本是有角度的ui-grid v3.0.6
,UPDATE table1, table2
SET table1.col = a,
table2.col2 = b
WHERE table1.id = table2 .id;
。