How do I remove a cell's value after a GridEvent has fired on that cell?
I have a Grid where I set values for the cells, based on a boolean: i.e. if true, then the cell is populated with "true", otherwise I return "". That's all fine.
However, I have added a listener to the column (where a cell is populated with a value, courtesy of a GridCellRenderer) and after performing some business logic, if the cell is clicked, I wish to remove the value for the cell that has been clicked. The reason is that it's value only applies PRIOR to the business logic having been performed: once the business part is complete, I don't want the user to have the choice of clicking that cell anymore.
I can, of course hide the column (via the ColumnConfig) but this is not optimum if another cell in that column (i.e. a seperate record) also has a value but it hasn't been clicked (therefore no GridEvent has been applied).
My need therefore, is Cell-specific: if clicked, do something, then remove value for that cell only.
Incidentally, forum and site is great to follow, especially to a novice like me.
My proposed solution did in fact produce the required result.
HOWEVER, it was always going to remain a momentary fix until the next call on the DB was made, which would simply rewrite the cells with whatever the data was at the time of the new call!!
Therefore my real solution involved updating the data in the DB correctly (which, it turns out I wasn't. ).
So the upshot is: let the DB feed the cells with the data sought; JUST ENSURE YOU HAVE MADE THE RIGHT DATA MANIPULATION CALLS FIRST! Fix the back-end work and the I/F will be populated accordingly.
So says the novice!