How can I check if a Kendo Grid has changes? I heard that there is a dirty
property, but I cant find it.
So, if NOC Code=='C01', then COR ABA No. is editable, otherwise it is not. I have achieved this by adding the Edit event on the columns and in that edit handler disabling the HTML input Kendo creates, when no editing is allowed. (In the grid definition, I have Editable(true) to start).
kendo:grid-pageable-messagesThe text messages displayed in pager. Use this option to customize or localize the pager messages. More documentation is available at kendo:grid-pageable-messages.
autoBind Boolean (default: true)By default, autoBind is set to true and the widget will bind to the data source specified in the configuration. Setting autoBind to false is useful when multiple widgets are bound to the same data source.
You can use the 'hasChanges' method on the Grid's underlying DataSource:
grid.dataSource.hasChanges(); $('#divGrid').data('kendoGrid').dataSource.hasChanges();
Added rows will have the dirty property set to true and so will updated rows. But, deleted rows are stored elsewhere (in the _destroyed collection). Pass this function the datasource of your grid to see if it has changes.
function doesDataSourceHaveChanges(ds) { var dirty = false; $.each(ds._data, function () { if (this.dirty == true) { dirty = true; } }); if (ds._destroyed.length > 0) dirty = true; return dirty; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With