mcgaffin
08-24-2004, 06:55 AM
Here is a grid with an onclick event:
<canvas debug="true">
<dataset name="griddata">
<result>
<item brand="Continental" model="GP3000" color="black" />
<item brand="Vittoria" model="Rubino" color="black/red" />
</result>
</dataset>
<grid datapath="griddata:/result">
<method event="onclick">
debug.write("clicked the grid");
</method>
</grid>
</canvas>
It appears that the onclick event is only received by the grid if I click in an empty area of the grid, rather than on one of the rows. I have noticed that I can define an onclick method for a gridcolumn and handle the clicks that way. However, with the data I am using, I don't know what columns are in my dataset. One set could be
<result>
<item brand="Continental" model="GP3000" color="black" />
</result>
while in the same interface I might get a dataset like this:
<result>
<item category="enterprise" office="Tulsa" department="Sales" />
</result>
Is it possible to have one grid that can display both datasets and receive onclick events at the grid level? Alternatively, is there a better way to receive an event when a grid selection changes?
Thanks.
- david
<canvas debug="true">
<dataset name="griddata">
<result>
<item brand="Continental" model="GP3000" color="black" />
<item brand="Vittoria" model="Rubino" color="black/red" />
</result>
</dataset>
<grid datapath="griddata:/result">
<method event="onclick">
debug.write("clicked the grid");
</method>
</grid>
</canvas>
It appears that the onclick event is only received by the grid if I click in an empty area of the grid, rather than on one of the rows. I have noticed that I can define an onclick method for a gridcolumn and handle the clicks that way. However, with the data I am using, I don't know what columns are in my dataset. One set could be
<result>
<item brand="Continental" model="GP3000" color="black" />
</result>
while in the same interface I might get a dataset like this:
<result>
<item category="enterprise" office="Tulsa" department="Sales" />
</result>
Is it possible to have one grid that can display both datasets and receive onclick events at the grid level? Alternatively, is there a better way to receive an event when a grid selection changes?
Thanks.
- david