Aug 31, 2011, 9:46 PM
[CLOSED] Get selected node in javascript (Treegrid)
Hi,
I'm attempting to pass the current node to a javascript function from a XTemplate. The first time I click on the column the selectedNode returns null, however, all subsequent clicks work just fine returning the node object. Is there a way to ensure I get the node on the first click?
Here's my grid:
I'm attempting to pass the current node to a javascript function from a XTemplate. The first time I click on the column the selectedNode returns null, however, all subsequent clicks work just fine returning the node object. Is there a way to ensure I get the node on the first click?
Here's my grid:
<ext:TreeGrid ID="Grid1"
ClientIDMode="Static"
runat="server"
Border="false"
MonitorResize="true"
Region="Center"
EnableSort="false"
AutoDataBind="true">
<Columns>
<ext:TreeGridColumn AutoDataBind="true" Header="" Width="20" DataIndex="Chart">
<XTemplate runat="server">
<Html>
<img onclick="alert(Grid1.getSelectionModel().getSelectedNode());" src="chart.png"></img>
</Html>
</XTemplate>
</ext:TreeGridColumn>
</Columns>
<Listeners>
<ContextMenu Fn="captureRightClick" />
<ExpandNode Fn="loadMeters" />
</Listeners>
</ext:TreeGrid>
Thank you.