Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Tejas Shah on Mar 15, 2009 01:38
open dhtmlx forum
:: DHX Grid :: <input> tag's attribute order gets changed.

Hi there,

When I try to set the cell's value through setValue() like following, it gets added to the respected cell.

libTableGrid.cells(libTableGrid.getSelectedId(),3).setValue("ttttt<input type=\"image\" alt=\"1\" size=\"1\" value=\"47504\" src=\"htmlarea/images/footnote.gif\" title=\"47504\" order=\"1\" /> ")

BUT

when I try to get value through getValue() of that same cell, I get following.

ttttt<input alt="1" size="1" value="47504" src="htmlarea/images/footnote.gif" title="47504" order="1" type="image">

If you observe, the attributes of input tag gets reShuffled which creates problem

Why the type attribute got shuffled ????
Please help into this.


Answer posted by Support on Mar 16, 2009 06:26
Grid doesn't store original HTML value provided for the cell, it is injected inside HTML page and browser may affect it. 
In above case browser ignores unknown attribute , so it is missed.

Grid can store and retrieve plain values, but in case of HTML formated values - they will be rendered in grid correctly ( according to HTML rules ) , but result of getValue against such cell depends on browser.
Answer posted by Tejas Shah on Mar 16, 2009 07:13
Hi there,

Please see that attributes are not missed out but they have got shuffled.
Answer posted by Tejas Shah on Mar 18, 2009 05:24
Hi,

Is there some way to sort this issue ?
Answer posted by dhxSupport on Mar 18, 2009 06:47
Unfortunately there is no way to sort this problem because of order of html attributes depends on the browser.