Hi Danil,
Thanks for contacting Syncfusion Support.
We could see you would like to perform the CRUD operations in Grid after populating them using the local data and perform the filtering and sorting operations in the Grid. We have prepared a sample with your requirement that can be downloaded from the following location.
CRUD Operations in the Grid can be achieved using the certain adaptor support provided by the ejDataMananger which can be referred from the following Help Document.
Among these adaptors, we have used removeSaveAdaptor to achieve your requirement which will bind local data to the Grid and serves the CRUD Urls for performing the editing/deleting/adding actions in the Grid. Refer to the following code example.
<ej-grid id="Grid1" allow-sorting="true" allow-filtering="true" allow-paging="true">
<e-datamanager json="ViewBag.order" insert-url="/Home/CellEditInsert" update-url="/Home/CellEditUpdate" remove-url="/Home/CellEditDelete" adaptor="remoteSaveAdaptor" />
<e-edit-settings allow-adding="true" allow-deleting="true" allow-editing="true" />
<e-filter-settings filter-type="Menu" />
<e-columns>
<e-column field="ID" header-text="Employee ID" is-primary-key="true"></e-column>
. . .
. .
</e-columns>
</ej-grid> |
Please make a note that is-primary-key is necessary while performing editing operation in the Grid. To enable edit/add/delete operations in the Grid, you have to set the allow-editing, allow-adding and allow-deleting properties of the Grid e-edit-settings. Please refer to the following Help Documents.
To enable the filtering and sorting properties in the Grid, you have to set the allow-sorting and allow-filtering properties of the Grid. Grid also provides several filtering types, which can be referred from the following Help Documents.
Refer to the following ShowCase demos.
Regards,
Seeni Sakthi Kumar S.