Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Ashutosh Agarwal on Nov 29, 2007 01:59
open dhtmlx forum
DNTMLxGrid checkbox values in a cell

Hi,
In a column, I am showing check boxes. I want the value of column to be other than true or false. I want to set these values from xml.

Regards,
Ashutosh Agarwal
Answer posted by Stanislav on Nov 29, 2007 03:42
Such functionality is not available, checkbox columns has hardcoded  0 and 1 as values for checked and unchecked states, the only way to change behavior - customization of js code.
If necessary I can provide additional info where customization need to be done ( there is no ready to use solution )
Answer posted on Nov 29, 2007 03:46
Yes please provide additional info where customization need to be done.
Answer posted by Stanislav on Nov 29, 2007 03:55
dhtmlxgridcell.js  lines 476

                            if(this.val=="1")    //need to be updated with necessary checked value
                                this.setValue("0") //need to be updated with necessary unchecked value
                            else
                                this.setValue("1")  //need to be updated with necessary checked value

dhtmlxgridcell.js  lines 517

                        if (val){
                            val=val.toString()._dhx_trim();
                            if ((val=="false")||(val=="0")) val="";
                            }
                        if(val){  //need to be updated with correct rule
                            val = "1";
                            this.cell.chstate = "1";//need to be updated with necessary checked value
                        }else{
                            val = "0";
                            this.cell.chstate = "0"//need to be updated with necessary unchecked value

You can replace mentioned places with another hardcoded value, or with some js vars which will be set separatly