pep
05-20-2004, 09:56 PM
I have a grid containg numbers, the positives are black and the negative are red, I load it like this:
[code]
<method name="setcolors"><![CDATA[
var txt=this.getText();
if(txt.IndexOf('-')==0)
this.setColor(0xFF0000);
else
this.setColor(0x000000);
]]>
</method>
[\code]
I first tried to call this method with ondata="this.setcolors()" , but it did not worked
(none were turned red)
I then used a trick and called this method when I show this view wich is hidden by default.
But when I sort the data in the grid, the red lines remains at the same position while the numbers move, so that none is displayed correctly.
so I am looking for a trick to do something like:
onsort="this.setcolors()"
[code]
<method name="setcolors"><![CDATA[
var txt=this.getText();
if(txt.IndexOf('-')==0)
this.setColor(0xFF0000);
else
this.setColor(0x000000);
]]>
</method>
[\code]
I first tried to call this method with ondata="this.setcolors()" , but it did not worked
(none were turned red)
I then used a trick and called this method when I show this view wich is hidden by default.
But when I sort the data in the grid, the red lines remains at the same position while the numbers move, so that none is displayed correctly.
so I am looking for a trick to do something like:
onsort="this.setcolors()"