Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
145364 | Jun 18,2019 08:59 AM UTC | Jun 21,2019 04:28 AM UTC | jQuery | 5 |
![]() |
Tags: ejmGrid |
let grid: Grid = new Grid(
{
dataSource: [],
editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Normal', newRowPosition: 'Top' },
allowPaging: true,
dataBound: function(args){
if(grid.getCurrentViewRecords().length > 0)// to disbale the add toolbar during intial rendering
grid.toolbarModule.enableItems(["Grid_add"],false);
},
actionComplete: function(args){
if(args.requestType == "save"){// to disbale the toolbar when a record is added
setTimeout(function(args){
grid.toolbarModule.enableItems(["Grid_add"],false);
}.bind(grid),0)
}
},
pageSettings: { pageCount: 5 },
………………………….
});
grid.appendTo('#Grid'); |
<script type="text/javascript">
$(function () {
$("#Grid").ejGrid({
dataSource: window.gridData,
dataBound: function (args) {
if (this.model.currentViewData.length > 0)
$("#Grid_add").addClass("e-disable") // Use your grid ID here.
},
allowPaging: true,
editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true },
toolbarSettings: { showToolbar: true, toolbarItems: [ej.Grid.ToolBarItems.Add, ej.Grid.ToolBarItems.Edit, ej.Grid.ToolBarItems.Delete, ej.Grid.ToolBarItems.Update, ej.Grid.ToolBarItems.Cancel] },
columns: [
………………………………………….
]
});
});
</script> |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.