Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Irina Smirnova on Oct 03, 2008 00:05
open dhtmlx forum
Formatted Cell value

Hello,

here: http://dhtmlx.com/docs/products/kb/index.shtml?cat=search&page=1&q=5001&ssr=yes&s=cell%20value it is said that

If you have used inline tags in cell as
<cell><![CDATA[ <a ...>some </a> ]]></cell>
all value inside cell tag treated as cell value and will be included in serialization, it is expected behavior.

I need to get value of a cell which is printed like this:

print("<cell>");
print("<![CDATA[");
print($row["old_awayodds"]);
if($row["old_awayodds"]<$row["awayodds"])
print("<img src='../../codebase/imgs/up.gif'><b>");
else if ($row["old_awayodds"]>$row["awayodds"])
print("<img src='../../codebase/imgs/down.gif'><b>");
else if(trim($row["old_awayodds"])!= "" || trim($row["awayodds"])!="")
print("<img src='../../codebase/imgs/equal.gif'><b>");
print($row["awayodds"]);
print(" ]]>");
print("</cell>");

When I call alert mygrid.cells(rowID,celInd).getValue() I get <B title="cell_value " _title="true">cell_value </B>

What can I do to get the pure cell_value?

Thank you very much
Answer posted by Support on Oct 03, 2008 01:53
If you are using HTML tags inside the cell content they may be changed during rendering, and it will affect data returned by getValue ( adding of title attribute) 
The CDATA has meaning only as part of XML , so it not treated as part of cell value ( it possible to enable serialization option, so grid will wrap data of cell in CDATA automatically, but it will not affect getValue method )