|
#1
|
|||
|
|||
|
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() |
|
#2
|
|||
|
|||
|
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 |