I have a grid where I'm doing client side validations in javascript, and coloring the invalid cells by first getting the tds using the cellAt method and then adding a style to them in jQuery. The problem is that after another cell is edited, the entire row is rerendered, destroying the tds and their accompanying styles. Is there any way to make these styles survive the rerendering after a cell leaves edit mode?
Hello rgvaughan,
Thank you for your follow-up.
Please let us know if we can assist you further with this matter.
Hi Radoslav,
I'm not using the built-in validations because many of the ones I needed to implement are very complex and involve fields from multiple rows and from other grids on the page.
Thanks for your response. I actually have editMode set to "cell", but it still destroys every td in the row and rerenders them after the single cell comes out of edit mode. Yes, the client-side validations are custom written in Javascript. My solution right now is to keep a cache outside the grid of all the validation errors with a cross-reference of the row keys and column names, and color all the invalid cells in the rowsRendered event, which fires whenever a cell comes out of edit mode. This seems to be working pretty well.
Hi,
i am afraid this isn't possible unless you change the editMode to "cell" instead of "row". we will be releasing conditional formatting functionality in one of the next releases, so you can expect this (and much more scenarios ) to work out of the box.
are your client-side validations custom? An alternative i can think of is (if of course you want editMode to be "row") to handle the editRowEnded client-side event and apply the styles to all cells at once (or one by one depending on your validation logic).
Hope it helps. Thanks,
Angel
Hello @rgvaughan,
You are correct for this, does the built-in validation work for you?