Go Back   SmartClient Forums > Technical Q&A
Wiki Register Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 13th Feb 2007, 12:00
tgochenour tgochenour is offline
Registered Developer
 
Join Date: Jan 2007
Posts: 135
Default ListGrid Data Changed Event

Is there an event that tells me editing has occurred in one of my ListGrid cells?

Something analogous to DynamicForm.valuesHaveChanged().

------

Also, is there something similar to DynamicForm.resetValues()
Reply With Quote
  #2  
Old 15th Feb 2007, 13:21
Isomorphic Isomorphic is online now
Administrator
 
Join Date: May 2006
Posts: 30,578
Default

Hi,
Yes in the 5.5.1 release we have some (in some cases un-documented) APIs that allow you to do this:

ListGrid.getAllEditRows() will return an array or row-numbers - every row the user has edited that has not been saved
(This is documented in 5.5.1, here)


ListGrid.getEditValues(rowNum) will return the current edit values for a row - If the user has not edited the row, this will return null - otherwise it will return an object containing the new value for each edited field by fieldName for the row.
(this one is undocumented in 5.5.1, but will be exposed in the next release, version 5.6)

ListGrid.rowHasChanges(rowNum) will check whether the user has actually modified the values for a row - essentially comparing the result of this.getEditValues(rowNum) with this.getRecord(rowNum)
(undocumented in 5.5.1, will be exposed in the next release, version 5.6)


For resetting edit values there are a couple of methods:

To drop all un-saved edit values for every row in the grid you can use ListGrid.discardAllEdits().
(Undocumented in the 5.5.1 release - will be exposed in the next release)

To drop all edits for a row you can call ListGrid.discardEdits(rowNum) for the row in question.
(Again undocumented in 5.5.1 - will be exposed in our documention soon)

To clear an edit value for a single cell, you can also call ListGrid.clearEditValue(rowNum, fieldName).
Note that this one is publicly documented in 5.5.1, here

I hope this gives you what you need
Thanks
Isomorphic Software
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search


© 2010,2011 Isomorphic Software. All Rights Reserved