format for column

Hi,



I am using licensed version of dhmtlx treegrid v 2.1 with split mode. The treegrid is not created with xml. I am creating the treegrid from an array.



The headers are created using the setHeader function , where in i pass a comma separated string of header names. I want number and date formating for my columns. I tried few samples using xml loading , in which i can set formats like .,









How can i set the formats with code , as I am not using xml loading.



I found 2 functions in the API doc.



setDateFormat(…) [Professional] - set mask for date formatting in cell

setNumberFormat(…) [Professional] - set mask for formatting numeric data ( works for [ed/ro]n excell only or oher cell types with suport for this method)



How can i use these 2 functions , give me a example / sample.



Is there any function similar to the above 2 to set the formats at the column level [ rember i am not using xml].








If you are loading grid via javascript array, you can set number and date fromat only with API:


mygrid.setColTypes(“dhxCalendar,end”);


mygrid.setDateFormat("%m/%d/%Y"); // => 01/25/1980


mygrid.mygrid.setNumberFormat(1,“0,000.00”,",","."); //1456.789 => 1,456.78


You can find more information here dhtmlx.com/docs/products/dhtmlxG … ormatcells