Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Mike Peremsky on Oct 27, 2008 11:11
open dhtmlx forum
addRow has issues parsing link with a comma in it

Hi,

I am trying the grid out to see if we want to use it in our application. So far it has looked pretty nice. However, I am running into an issue with the addRow call. When calling addrow it parses the comma delimited data and puts it into the individual columns. The problem I am running into is the following.

The first column in my table takes a link which looks similar to the following:

<a href="javascript:highlight(123,12.0001,13.123)">1</a>

The whole string looks similar to

<a href="javascript:highlight(123,12.0001,13.123)">1</a>,col2,col3

When addRow is called it sees the commas in the first column (link) and gets confused and parses out each piece as a new column. I have tried other methods (creating a JS array and passing it -> no data displayed, just blank rows, I've tried quoting the entire link field ->

Is it possible to change the parse delimiter for addRow?

TIA

- Mike
Answer posted by Support on Oct 28, 2008 02:49
The addRow command has alternative syntax
   grid.addRow(123,"1,2,3");
or 
   grid.addRow(123,["1","2","3"]);

When using second approach - any value can be used, includinng values with comma inside.

>>Is it possible to change the parse delimiter for addRow?
Yes,
        grid.setDelimiter("any_char");
Answer posted by Mark Ritter on Dec 18, 2008 13:37

Another weird thing related to this:

If you have this in a column text: xxxx&yyyyy  (just for example) it will cut off at the &. 

But xxxx & yyyy

will work fine with spaces.

 

Answer posted by Support on Dec 19, 2008 02:03
The browser (IE)  threates any &nnn sequences as HTML entities
By default grid renders cell content as HTML, but you can change it to pure-text behavior, just use differnt column types
  ro => rotxt
  ed => edtxt
  txt => txttxt
  coro => corotxt

for such column types, special chars, as  & < >, will be threated correctly.