PDA

View Full Version : setting data into grid cell



emmas
23 Aug 2010, 5:52 PM
Hi,
On my editable grid
some of the columns set up to be editable and some of them get data retrieved from the database.
After entering data in one column, I populate some of the cell for that row from the result set stored procedure returns.


paymentGrid.getStore().getAt(row).set(Field.fan, invoiceData.getFan());



The problem is that it's not visible until I change data in any other editable cells, in other words after any records get updated on that row.


I could set the data into the record for that cell like this:


paymentGrid.getStore().getRecord(selectedPayment).set(Field.fan, invoiceData.getFan());


In this case it will be visible right away, but it will have the red corner (modified record identifier), which I don't want, since it's not modified record but data retrieved from the database.


So my question is how do I set data into grid cell and make it visible right away ?


thanks

micgala
24 Aug 2010, 12:15 AM
Just call the update method (which will fire the event for refreshing the row) after setting the new data into the store:
paymentGrid.getStore().update(paymentGrid.getStore().getAt(row);

Regards,
Michel.

emmas
24 Aug 2010, 9:16 AM
thank you Michel very much, it works.