View Full Version : Reload only one row in the grid - extjs4

10 May 2012, 12:23 AM
Hi All,

I want to reload or refresh only one row in the grid. Is it possible?

Store.load(); will reload all the data ...

is there any function available to reload only one data

10 May 2012, 12:48 AM
You can use Ext.Ajax.request() to request the wanted record. On its callback, update received record to the store.

30 May 2012, 6:21 AM
What if I need to load rows only when data changed on server? It is possible to do without single AJAX request?

30 May 2012, 2:38 PM
That could be done either on the server side or the client. Either way you're probably still using Ext.Ajax.request(). Server side, you could upload all the data from the store in a request to the server then let the server side script compare your data to what it's got in the database and return any new/changed/deleted records. Client side, you do the same thing in reverse. Create a new store and load all information, compare your new store to the old using ids in case something's been added/deleted. If anything is different, remove the record from the old store, and add the corresponding one from the new. Additionally, if any of the records are not found, remove them, and if there are new records, add them.

Good luck!

30 May 2012, 5:14 PM
I agree is better in the server side, which will give you exactly what you need and you won't increase the load of the interface doing stuff you can easily do in the server.
Use limit 1 if you use sql, or just return model[0] to get the first row of your model object ow something similar.