kermit
10-24-2008, 12:02 AM
Hello,
Can someone explain me why $path do not work with grid component?
Next question : there is several way to access attribute, which one is the correct one. I get a deprecated warning in debug console for getAttribute, it do no behave as this['attribute'], I think of enabled attribute for instance. Can someone clarify ?
<canvas debug="true">
<include href="../lps/components/utils/layouts/simplelayout.lzx" />
<include href="../lps/components/lz/gridcolumn.lzx" />
<dataset name="ds">
<items>
<item name="n1" value="1"/>
<item name="n2" value="2"/>
<item name="n3" value="3"/>
</items>
</dataset>
<simplelayout axis="y" spacing="15" ></simplelayout>
<grid datapath="ds:/items" contentdatapath="item">
<attribute name="test" value="$path{'@name'}"/>
<handler name="ontest" args="data">
Debug.write("ontest: " + data);
Debug.write("this['test']: " + this['test']);
Debug.write("this.getAttribute('test'):"
+ this.getAttribute('test'));
Debug.write('test: ' + test);
Debug.write('this.test: ' + this.test);
</handler>
<gridtext datapath="@name"/>
</grid>
<grid datapath="ds:/items" contentdatapath="item">
<gridtext datapath="@name">
<attribute name="test" value="$path{'@name'}"/>
<handler name="ontest" args="data">
Debug.write("ontest: " + data);
Debug.write("this['test']: " + this['test']);
Debug.write("this.getAttribute('test'):"
+ this.getAttribute('test'));
Debug.write('test: ' + test);
Debug.write('this.test: ' + this.test);
</handler>
</gridtext>
</grid>
</canvas>
regards,
Can someone explain me why $path do not work with grid component?
Next question : there is several way to access attribute, which one is the correct one. I get a deprecated warning in debug console for getAttribute, it do no behave as this['attribute'], I think of enabled attribute for instance. Can someone clarify ?
<canvas debug="true">
<include href="../lps/components/utils/layouts/simplelayout.lzx" />
<include href="../lps/components/lz/gridcolumn.lzx" />
<dataset name="ds">
<items>
<item name="n1" value="1"/>
<item name="n2" value="2"/>
<item name="n3" value="3"/>
</items>
</dataset>
<simplelayout axis="y" spacing="15" ></simplelayout>
<grid datapath="ds:/items" contentdatapath="item">
<attribute name="test" value="$path{'@name'}"/>
<handler name="ontest" args="data">
Debug.write("ontest: " + data);
Debug.write("this['test']: " + this['test']);
Debug.write("this.getAttribute('test'):"
+ this.getAttribute('test'));
Debug.write('test: ' + test);
Debug.write('this.test: ' + this.test);
</handler>
<gridtext datapath="@name"/>
</grid>
<grid datapath="ds:/items" contentdatapath="item">
<gridtext datapath="@name">
<attribute name="test" value="$path{'@name'}"/>
<handler name="ontest" args="data">
Debug.write("ontest: " + data);
Debug.write("this['test']: " + this['test']);
Debug.write("this.getAttribute('test'):"
+ this.getAttribute('test'));
Debug.write('test: ' + test);
Debug.write('this.test: ' + this.test);
</handler>
</gridtext>
</grid>
</canvas>
regards,