bvikram_singh
09-12-2005, 01:52 AM
Hi everybody,
I am new in laszlo application working on grid components. In my application, I want to capture data of cell, when it is clicked. In my sample code given below,for example when cell having value "Homer" is
clicked, I want to capture this value.... Thanks in advance
canvas debug="true" height="250">
<dataset name="contacts">
<myXML>
<person show="simpsons1">
<firstName>Homer</firstName>
<lastName>Simpson</lastName>
</person>
<person show="simpsons2">
<firstName>Marge</firstName>
<lastName>Simpson</lastName>
</person>
<person show="simpsons3">
<firstName>Montgomery</firstName>
<lastName>Burns</lastName>
</person>
</myXML>
</dataset>
<grid multiselect="false" showhlines = "true" showvlines= "true" datapath="contacts:/myXML">
<gridtext doesenter = "true" showheader="false" editable="false" width="100" datapath="@show" >
</gridtext>
<gridtext showheader="false" datapath="firstName/text()" editable="false" width="200">
</gridtext>
<method event="onselect">
<![CDATA[
var id = this.getSelection().p.attributes.show;
Debug.write( "ID " + id );
]]>
</method>
</grid>
</canvas>
I am new in laszlo application working on grid components. In my application, I want to capture data of cell, when it is clicked. In my sample code given below,for example when cell having value "Homer" is
clicked, I want to capture this value.... Thanks in advance
canvas debug="true" height="250">
<dataset name="contacts">
<myXML>
<person show="simpsons1">
<firstName>Homer</firstName>
<lastName>Simpson</lastName>
</person>
<person show="simpsons2">
<firstName>Marge</firstName>
<lastName>Simpson</lastName>
</person>
<person show="simpsons3">
<firstName>Montgomery</firstName>
<lastName>Burns</lastName>
</person>
</myXML>
</dataset>
<grid multiselect="false" showhlines = "true" showvlines= "true" datapath="contacts:/myXML">
<gridtext doesenter = "true" showheader="false" editable="false" width="100" datapath="@show" >
</gridtext>
<gridtext showheader="false" datapath="firstName/text()" editable="false" width="200">
</gridtext>
<method event="onselect">
<![CDATA[
var id = this.getSelection().p.attributes.show;
Debug.write( "ID " + id );
]]>
</method>
</grid>
</canvas>