I need to set all columns to #.### I enabled the auto format and tried to set each column.format but its not working. Also when I edit a cell to 9.0000000000 it puts 9... in my cell. I need a way to set my cells to a fixed format, is that possible?
This works for me:
{ headerText:"Est Price($)", key: "EstUnitPrice", dataType: "number", format: "########.##", width: "60" },
Don't know about autoFormat, I have never used that.
I think my issue is I have to set it after the data is loaded. So I use this approach
$( INSTANCE.gridIDMap.option( "columns" ) )[c].format = "#.000";
basically meaning. fin the grid instance and get all columns, then set the format filed. This is in a loop of course c being the column.
auto format works buts I need more control.
Hello seang,
It has been a while since your last post, but in case you need further assistance I will be glad to help you.
Please note that if you want to set a specific format for the cells in column you may use the format option of the grid columns, for instance:
{ headerText:"TestColumn", key: "TestColumn", dataType: "number", format: "########.00" }
Setting of several "#" signs after the decimal point represents an optional length of the decimal number. Whilst setting of "0" after the decimal point represents a fixed decimal sign number. So if you have format: "########.00" then when you type in 9.00 the result will be the same. Otherwise if you have format: "########.##" and you type in 9.00, then the result would be only the integer number 9.
Attached is a sample for your reference.
If you have any further questions, please let me know.
Sincerely,
Tsanna