|
Index.ts
let grid: Grid = new Grid(
{
dataSource: orderDataSource,
rowDataBound: function (args) {
if ((args.data as any).ShipCountry === "Brazil") {
args.row.classList.add('customcss');
}
},
editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Normal', newRowPosition: 'Top' },
allowPaging: true,
pageSettings: { pageCount: 5 },
toolbar: ['Add', 'Edit', 'Delete', 'Update', 'Cancel'],
columns: [
. . . . . .
. . . . . .
],
});
grid.appendTo('#Grid');
document.getElementById('button').addEventListener("click", function (args) {
var grid = (document.getElementsByClassName('e-grid')[0] as any).ej2_instances[0];
var obj = {OrderID: 10248, CustomerID: "Edge", Freight: 22.38, ShipCountry: "USA"};
grid.setRowData(10248, obj);
})
|
|
Index.html
<style>
body{
touch-action:none;
}
.e-grid .e-gridcontent tr.e-row.customcss{ //customcss
font-weight: bold;
}
</style>
|