<script type="text/javascript">
$(function () {
$("#Grid").ejGrid({
// the datasource "window.gridData" is referred from jsondata.min.js
dataSource: window.gridData,
allowPaging: true,
actionComplete: function (args) {
if (args.requestType == "beginedit")
$("#" + this._id + "Verified").removeAttr("disabled").removeClass("e-disable");
},
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: [
{ field: "OrderID", isPrimaryKey: true, headerText: "Order ID", textAlign: ej.TextAlign.Right, validationRules: { required: true, number: true }, width: 90 },
..
{ field: "Verified", headerText: 'Verified', editType: ej.Grid.EditingType.Boolean, allowEditing: false, width: 90 }
]
});
});
</script> |
<script type="text/javascript">
$(function () {
$("#Grid").ejGrid({
// the datasource "window.employeeData" is referred from templatelocaldata.js
dataSource: window.employeeData,
enableRowHover: false,
allowSelection: false,
rowDataBound: function (args) {
if (args.rowData.Country == "UK")
$(args.row).find(".e-detailsbutton").hide();
},
columns: [
..
{
headerText: "Employee Details",
commands: [
{
type: "details",
buttonOptions: {
text: "Details",
width: "100",
click: "onClick"
}
}
],
isUnbound: true,
textAlign: ej.TextAlign.Left,
width: 150
}
]
});
..
});
</script> |
<style>
.e-grid.hideEditUnbound .gridform .e-unboundcelldiv{
display: none;
}
</style>
<script type="text/javascript">
$(function () {
$("#Grid").ejGrid({
// the datasource "window.employeeData" is referred from templatelocaldata.js
dataSource: window.employeeData,
enableRowHover: false,
allowSelection: false,
toolbarSettings: { showToolbar: true, toolbarItems: [ej.Grid.ToolBarItems.Add, ej.Grid.ToolBarItems.Edit, ej.Grid.ToolBarItems.Delete, ej.Grid.ToolBarItems.Update, ej.Grid.ToolBarItems.Cancel] },
editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true },
cssClass: "hideEditUnbound",
rowDataBound: function (args) {
if (args.rowData.Country == "UK")
$(args.row).find(".e-detailsbutton").hide();
},
columns: [
. . .
{
headerText: "Employee Details",
commands: [
{
type: "details",
buttonOptions: {
text: "Details",
width: "100",
click: "onClick"
}
}
],
isUnbound: true,
textAlign: ej.TextAlign.Left,
width: 150
}
]
});
});
</script> |