an question about the data validation and number format.

Dear Support Team,







I have an question about the data validation and number format.



First, when the user enter non-num value, the value should be converted to zero. It is support by set mygrid.setColTypes( dyn)



However , we want to set number format by mygrid.setNumberFormat(“0,000.00”,i). mygrid.setColTypes( dyn) doesn’t support setNumberFormat method.



How can the grid convert NaN into zero or orginal number and set number format simultaneously??? Thank











Best Regards



John Chan

You can use setNumberFormat and define a custom rule through onCellChanged event

grid.attachEvent(“onCellChanged”,function(id,ind,value){
if (ind = INDEX && (val != val || val==“NaN”)) this.cells(id,ind).cell.innerHTML=“0”;
});

where INDEX - index of column in question


how can i change the color of  some certain rows and columns? such as the subtotal row  containing in in xml   or change color of all the editable columns???Thx



 



 



 



 

If you need to change bg color of row you can use

grid.setRowColor(row_id, “red”);
or
grid.setRowTextStyle(row_id, “background-color:red;”);

>>or change color of all the editable columns???
You can set style for any necessary column by setCellTextStyle method
Colors of columns can be defined during grid initialization