Apr 10, 2015, 1:23 PM
Hi Dimitris,
Thanks, I can see the events, but not exactly sure how best to implement in my context. I am dealing with multiple treepanels (all built in code-behind) within a CardLayout panel and swap the relevant treepanel into view as required on client-side. (Each treepanel has unique ID). If I am understanding correctly it appears best approach is to pass some of the node attributes as well as node CustomAttributes (as in below example) from the respective clicked node to the ItemClick handler to then manage what needs to happen. Essentially I have a library of server-side methods that could be invoked depending on configuration. The onClick value held would be the method to call and would include the parameters to pass as well, often including {} curly braces and () brackets as well. Some examples of the XML values for onClick which I intend storing as CustomAttributes are:
Thanks, I can see the events, but not exactly sure how best to implement in my context. I am dealing with multiple treepanels (all built in code-behind) within a CardLayout panel and swap the relevant treepanel into view as required on client-side. (Each treepanel has unique ID). If I am understanding correctly it appears best approach is to pass some of the node attributes as well as node CustomAttributes (as in below example) from the respective clicked node to the ItemClick handler to then manage what needs to happen. Essentially I have a library of server-side methods that could be invoked depending on configuration. The onClick value held would be the method to call and would include the parameters to pass as well, often including {} curly braces and () brackets as well. Some examples of the XML values for onClick which I intend storing as CustomAttributes are:
onClick="do_something('{XEXFX3X4-EX99-4XE2-X0XF-51X7X4X5EX55}');"
onClick="do_something_else('1','0','00000000-0000-0000-0000-000000000000','YEYFY3Y4-EY99-4YE2-Y0YF-51Y7Y4Y5EY55','ZEZFZ3Z4-EZ99-4ZE2-Z0ZF-51Z7Z4Z5EZ55');"
do_something and do_something_else are server side methods. Intention was to call the method direct from an onclick event, hence have it pre-loaded. return new Ext.Net.Node
{
Text = text,
NodeID = nodeID,
Qtip = tooltip,
CustomAttributes =
{
new ConfigItem("pID", pID),
new ConfigItem("appID", appID),
new ConfigItem("children", children)
new ConfigItem("imageBase", imageBase),
new ConfigItem("imageOpen", imageOpen),
new ConfigItem("onClick",onClick)
}
};
PS. Can you also confirm I should strip {} curly braces / how to deal with it as it appears it is throwing problems on execution.
Last edited by Dimitris; Apr 12, 2015 at 6:47 PM.