Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Blake on Jan 26, 2009 14:55
open dhtmlx forum
Request for setColTextStyle() !

I see the API for:

setCellTextStyle(row_id, ind, styleString)
sets style to cell

and for:
setRowTextStyle(row_id, styleString)
sets style to row

but I need to set a specific style to a column, via JS (can't use XML doc), so I've had to do:

    for(var i=0; i<my_data.length; i++)
        mygrid.setCellTextStyle((i+1),0,"text-decoration:underline;cursor:pointer;");

to enable styles on just the first cell of each row. Is this something you guys can throw in?
Answer posted by Support on Jan 27, 2009 02:16
Do you need to define css class before loading data in grid, or change it dynamically?
In second case there is no alternative to used approach, it will be done through iteration in any case, may be rewritten in a bit stable way as

mygrid.forEachRow(function(id){
      mygrid.setCellTextStyle(id,0,"text-decoration:underline;cursor:pointer;");
});