Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by withzestmn on Mar 27, 2009 05:00
open dhtmlx forum
UserData in xmlB

Hi,
I wanna use userdata in xmlB way.
So, I generate the following xml data.

<rows>
<row id="TP012031">
<serviceNm> <![CDATA[ Blog ]]> </serviceNm>
<STS0000058_00>10</STS0000058_00>
<STS0000058_01>3< /STS0000058_01>
<userdata name="disable">AAA</userdata>
</row>

and I call the followings.
mygrid.load("grid.xml", "xmlB");     
var disable = mygrid.getUserData("TP012031", "disable");

The getUserData doesn't return anything.

I need your help..

Answer posted by dhxSupport on Mar 27, 2009 05:41

You should call getUserData method after grid was fully loaded:

mygrid.load("grid.xml", "xmlB",function(){

var disable = mygrid.getUserData("TP012031", "disable");

}); 

Answer posted by withzestmn on Mar 27, 2009 05:57

I want to use userdata on MouseOver event. Is it possible?

Answer posted by dhxSupport on Mar 27, 2009 06:19

Yes, its possible. Grid has event "onMouseOver" which contain information about rowId and cellIndex:

mygrid.attachEvent("onMouseOver",function(rowId,cellIndex){

//do smth

});

Answer posted by withzestmn on Mar 27, 2009 17:53

I can get global userdata when mouseover event occurs.
but, I can't get row's userdata. It returns blank string.

 

 alert( mygrid.getUserData("", "globaltest"));
  alert( mygrid.getUserData("TP012031", "test"));

 

The following is the part of my xml.

 <?xml version="1.0" encoding="utf-8" ?>
- <rows>
  <userdata name="globaltest">globalAAA</userdata>
- <row id="TP012031">
  <userdata name="test">AAA</userdata>
- <serviceNm style="font-family:Dotum;font-size:11px; background:#f1f1f3 url(/img/sds/bg_th.gif) no-repeat left top; color:#464646; border-right:1px solid #acacac !important; text-align:left;">
<![CDATA[ <img src='/img/sds/check.png' onclick='toggleRow(this,1);' name='service_add2' id='TP012031'>apple  ]]>
  </serviceNm>
  <STS0000058_00 style="background:#ffffff;" />
  <STS0000058_01 style="background:#ffffff;" />
  <STS0000058_02 style="background:#ffffff;" />
  <STS0000058_03 style="background:#ffffff;" />
  <STS0000058_04 style="background:#ffffff;" />
  <STS0000059_01 style="background:#ffffff;" />
  <userdata name="disable"> STS0000058_02,STS0000058_03</userdata>
  </row>
- <row id="TP012001">
  <userdata name="test">AAA</userdata>
.......


help me..^^:;