PDA

View Full Version : What is the gridview listener that refreshes a row layout when the record is updated?



mysticav
13 Oct 2014, 8:42 PM
Hi,

I have a grid to which I apply a custom css class to change the cells background color after grid is rendered.

The problem is that every time I updated a record, the specific row linked to that record is refreshed and the css classes I applied are lost.

view.refresh is not causing this, since view refresh is not triggered when updating a record.

So which is the listener responsible of this row refreshing ?

For instance this is a cell before record update:


<div class="x-grid-cell-inner myCSSClass" style="text-align:left;" id="ext-gen3758">200</div>

And after update it becomes:

<div class="x-grid-cell-inner " style="text-align:left;">500</div>

I need to keep the myCSSClass there.
Thanks.

slemmon
14 Oct 2014, 10:06 PM
Might be easier if you use the getRowClass method on the grid view:
http://docs.sencha.com/extjs/4.2.3/#!/api/Ext.grid.View-method-getRowClass

mysticav
14 Oct 2014, 11:28 PM
Is that method executed every time a record is updated, or only at rendering ?

slemmon
15 Oct 2014, 10:12 PM
Good point. Check out:
http://docs.sencha.com/extjs/5.0/apidocs/#!/api/Ext.view.Table-event-itemupdate

mysticav
15 Oct 2014, 10:14 PM
Already tried that and nothing.

I tried many different listeners from Table View.

That is why it is an enigma for me.