AutoSync Does Not Work in Grid When Using Server Grouping
Environment
Product | Progress® Kendo UI® Grid for jQuery |
Description
I have the autoSync
option set to true
in the Grid. If I enable server-side grouping and group the Grid by a column, the auto-sync functionality stops working.
Steps to Reproduce
- Create a Grid with the
editable: true
andgroupable: true
settings. - In the DataSource of the Grid, set
autoSync: true
andserverGrouping: true
. - Group the Grid by columns.
- Try to change a cell value in the Grid.
The Grid does not sync the changed value with the server. The auto-sync starts working if you ungroup the Grid.
Cause
This behavior is a limitation in the Grid. The default "incell"
editing mode combined with the autoSync: true
DataSource setting is not supported when you use server-side grouping in the Grid.
Suggested Workarounds
You can either:
Disabling Server Operations
In the dataSource
configuration of the Grid, set serverGrouping: false
. For the Kendo UI Grid for ASP.NET MVC, set ServerOperations(false)
in the DataSource
configuration.
This approach might decrease client-side performance especially when the Grid handles large amounts of data.
Saving Values Manually
When the Grid is grouped, manually call the saveChanges()
method of the Grid in the cellClose
event. This approach guarantees that the changes which are made in the cell before it was closed will be sent to the server.
function onCellClose(e) {
var grid = e.sender;
if (grid.dataSource.group().length > 0) {
grid.saveChanges();
}
}