Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by SFGolfer on Jun 02, 2009 04:41
open dhtmlx forum
Sub row styling

I'm trying to add css styling to a sub_row via xml:

print("<cell class=\"subrow\"><![CDATA[");
print($row['notes']);
print("]]></cell>");

This works if CDATA is not present but does not work in this example.

Is there another way of adding css to a sub_row?
Answer posted by Support on Jun 02, 2009 05:21
The same code works as expected in local samples - defined css class applied to the cell in question, but it will affect only cell in related column - not the text in sub-row

If you need to affect the text in sub-row - you can add custom rules to the dhx_sub_row css class
<style>
     .dhx_sub_row{
         font-weight:bold;
     }
</style>
Or use inline styles as
print("<cell class=\"subrow\"><![CDATA[<span class='subrow'>"); 
print($row['notes']); 
print("</span>]]></cell>");

Answer posted on Jun 02, 2009 05:27

Adding a sub_row css class worked.

However, the inline style added a '+' sign to every row - including rows that have no sub_row.

Answer posted by Support on Jun 02, 2009 06:58
It can be resolved by adjusting code of grid or server side code, which generates data. 
In case of server side code it will look as 
print("<cell class=\"subrow\">");
if ($row['notes']) print("<![CDATA[<span class='subrow'>".$row['notes']."</span>]]>");  
print("</cell>");

In such case , unnecessary tags will not affect empty sub-elements