I am using Kendo Grid (Kendogrid) for jquery. I have a tons of records to display in the grid with features like in-line editing, multi select, etc. It also requires to search, filter & sort records.
I have few issues as listed under:
- When we search any record using the Grid search box, I lose any changes that were done like changes in dropdown value, multi selected records, any in-line editing done in the textboxes.
- Also when I search any record and select it, then I clear the search, the selection goes away.
We have used the Kendo template for HTML.
Could please anyone guide me how to keep these changes and selection in the grid when user searches or filters any data in the grid.?
Also we do not want to push these changes in the database when user changes anything. We want to keep them within the data array of the grid.
Here is the link to my code:
https://dojo.telerik.com/ivIpepOM/2
Thank you Vishal
We tried the demos provided by Telerik and created our own from the below link. https://dojo.telerik.com/ivIpepOM/2
Your datasource is a remote data source. Everytime you change page in the grid or perform a search, the request goes to the server for the page of data to display. This is why your changes are not persisted. To persist them with a remote datasource you would need to add an update function to the datasource transport. Then either update the database (which I know you do not want to do) or somehow cache these pending changes on the server and use them when responding to the datasource read request.
Alternatively you can bind to local data. You would get all the data up to the browser first into a javascript array and then bind that to the grid. I believe any updates would then persist. This is only an option if the volume of data is small.
Another option is to keep track of any changes made client side (there are various events on the grid you can use for this). When the datasource read request returns from the server, update the response with those changes. See the event requestEnd on the datasource.
There are many ways to achieve what you want. The first step is in understanding the problem and possible solutions. I will have to leave it to yourself to decide which is the best solution to pursue.