gmro

I have a html table in a page and I want to transform it into a dhtmlxgrid, with custom attributes.



So i took the exaple from this site (dhtmlx.com/docs/products/dht … _html.html):









My Application

    

    

    

    

    

    

    



















































value 11 12
value 21 22
value 31 32
value 41 42
value 51 52








What I want now is to set attributes to this grid, like the ones that can be set to an xml-loaded grid. For example:

mygrid.setHeader(“Sales, Book Title, Author”);

mygrid.setInitWidths(“100,250,*”);

mygrid.setColAlign(“right,left”);

mygrid.setColTypes(“ed,ed,ed”);



How can I do that?



What I’ve tried is something I found as example on a site: I added two functions in the section of the html file and I put them in the tag, so now my html file looks loke this:









My Application

    

    

    

    

    

    

    



    

















































value 11 12
value 21 22
value 31 32
value 41 42
value 51 52








But this doesn’t solve the problem. The situation is like this:

- the Multiselect (from myfunc1) is enabled - this attribute works

- the header (from myfunc1) is NOT Col_1, Col_2 - this attribute does NOT work: on the first row (formated as a header) I have the (‘value 11’, 12) row



- the selectRow(2) (from myfunc2) works: the row (‘line 41’,42) is selected

- the setColTypes (from myfunc2) works

- the setColAlign (from myfunc2) does NOT work: both columns are left-aligned



Please tell me what am I doing wrong, why some attributes do not work. Or if you have a better approach to my needs, please tell me how should I set the dhtmlxgrid attributes to an existing html table.



Thank you!



Please check this articles dhtmlx.com/dhxdocs/doku.php?id=d … attributes