I am currently using the pro version of dhtmlxgrid.
Here is what I am doing:
I have a form with the dhtmlxgrid in it. And when the user clicks the submit button, I get the updated content from the grid using “gridObj.getChangedRows()”. Then I perform some operations on the changed content.
While defining the grid, I am setting the column type for 1 of my column as “edn”.
When I enter the integer “0” in any cell of this column, it gets trimmed automatically. I figure, this is part of the functionality used for trimming/pruning zeroes entered before any integer. Like, “000034” gets converted to “34”.
But what if I want to purposefully enter only 0 in this cell? Will it always get trimmed?
Because, when i enter 0 and hit submit button, i get nothing in the getChangedRows() result.
What should I do if I want to enable entering only 0 in “edn” coltype?
P.S: I can use only “edn” coltype for this column. Because I am using number format for that column.
If you enter “0” to the “edn” column it will be formated according with format which you have defined for this column.
If previous value of “edn” column was not “0”, this row will be marked as changed
If previous value of “edn” column was “0”, row will not be marked as changed, but you can set changed flag to the necessary cell manually with wasChanged(true) method of the cell object:
As for the “0”, getting trimmed automatically, it was a bug on my side. Nothing to do with the number format or grid.
As for the above suggestion, the idea worked for me, but I couldn’t get it using the method you suggested. I figured “wasChanged” is a property and not a method. Here is what i did to get it to work: