Connector beforeRender() & grid.cells.setValue() "conflict"

Hello

I setup a grid and a form.

When I update data in the form and click on the save button, a call to update somes filed in the grid is done by an event calling for example:

myGrid.cells(sid,3).setValue(myForm.getItemValue("myColumnToRefresh"));

Basically the value is a boolean (0/1) set as readonly in the grid.

The setValue() works fine: 0 or 1 is correctly set in the grid.

Now, if I setup a particular “beforeRender” event in connector to display “NOK/OK” instead of ‘“0/1”, it first dispalys fine, but as soon as I change the boolean value in the form, the grid displays “undefined” instead of “OK”’ or “NOK”.

A myGrid.clearAndLoad() instead of targeted cells setValues() avoid the “undefined” problem… but I loose all my filters and ordering on my grid columns.

Any clue on how to go further and to get the beforeRender action executed (or a beforeRender-like operation) when teh cells updates comes from the client side ?

See it here : ks369381.kimsufi.com/hebergement … rents.html

Regards

Matt

Hi

on my example site, since my post, please note that I setup a logic : ‘Dossier’ checkbox is set checked programaticaly when the two others are checked.

Matt

There is an authorization required on your example page. So the page cannot be viewed.

Hi

yes, I prefer locking everything when not needed.

I setup a clearAndLoad() to avoid the behaviour… but I loose all my filters… now I’m searching for a method to restore all filters as before the clearAndLoad()

matt

You may try to use getFilterElement() method to get the value of the filter’s input:

var filterObject=mygrid.getFilterElement(index).value; //get the value mygrid.getFilterElement(index).value=filterObject; // set the value (filterByAll should be called to apply filtering after the setting the value)