PDA

View Full Version : Refresh only one row in a Grid



grubby69
30 Aug 2011, 11:03 PM
Hi!

How can I write a code that can refresh only one row in a grid???
I have search in the Api docs but don't found nothing...

Is there a mode?

I have a GridPanel with a JsonStore data and a ColumnTemplate with Xtemplate.
With the

Ext.getCmp("mygridid").getStore().reload() or the

Ext.getCmp("mygridid").getView().refresh();
I refresh all the store and grid but I want to refresh only one row,possibli selecting the row with the RowSelectionModel.

If someone have ideas write here.

thanks a lotB)

grubby69
31 Aug 2011, 3:25 AM
After 2 days of head breaking I have found the solution.....and is soooo small!!!



grid.getView().refreshRow(record);

With this code you can refresh a single row in the grid,and I do it after a gridrowselect.
Really very happy!!!:D

dmackerman
31 Aug 2011, 7:02 AM
Yep. Private functions are always fun... :)

grubby69
31 Aug 2011, 7:29 AM
Yes!
The fact is that there isn't in the Api Documentation EXT 3.4 this method (refreshRow) in the GridView ...and so I didn't know it existance....but searching in the web I find this page : http://www.sencha.com/learn/grid-faq/
and there I found the solution.

I don't know why it isn't documentated in the API....:-?

Bye!

Artur Bodera (Joust)
30 Sep 2014, 3:41 AM
In Ext 5.0+ (probably also 4.0) the method is now called refreshNode().