I'm trying to do CRUD with kendo grid using local data. my kendo grid set is
var configSetupGird = $("#facility-setup").kendoGrid({ dataSource: { schema: { model: { id: "configId", fields: { noofblocks: { type: "string" }, noofchairspertable: { type: "string" }, noofcolumns: { type: "string" }, noofrows: { type: "string" }, nooftables: { type: "string" }, color: { type: "string" } } } } }, sortable: true, toolbar: [{ template: kendo.template($("#addSetupTable").html()) }], columns: [ { field: "noofchairspertable", title: "Chairs (PerTable)", }, { field: "noofblocks", title: "# Blocks" }, { field: "noofrows", title: "# Rows" }, { field: "noofcolumns", title: "# Columns" }, { field: "color", title: "Color" }, { command: [ { name: "delete", text: "Delete", click(evt) { var tr = $(evt.target).closest("tr"); var data = this.dataItem(tr); }, }] } ]}).data("kendoGrid");
so when i add data
var data = $('#setupTableForm').serializeObject();data.configId = Math.floor(Math.random() * (100 - 0 + 1)) + 0;tableSetup.push(data);configSetupGird.dataSource.data(tableSetup);configSetupGird.dataSource.read();configSetupGird.refresh()
but this is not updating when i see the datasource objecti can see there already have added data here with i attached the browser console view what was the problem ?
thanks