Aug 03, 2011, 2:03 PM
[CLOSED] Advice for dynamic multiple tabs
Hi,
Please could you advise on the best way to achieve the following in Ext.NET:
I have a tabPanel, and I add tabs when the user right-clicks on a tree node. So the tree might have 5 nodes, and the user can right-click any of these nodes and "view details tab" (all currently working with partial views).
Now, each tab that is rendered needs to have a javascript object associated with it that maintains changes which the user makes to that tab, and also responds to events on that tab such as button presses etc. So for example I have a "DetailsTab" class in JS.. I need to instantiate an instance of this class for each tab (var tabChanges = new DetailsTab()), and then when the user for example adds something using the UI, this needs to fire some code in that js class instance..
Also, I need to be able to target event handlers in my ext.net elements inside that tab. So for example if there is a "save" button then I need the <Click> listener to target the save function on my class instantiation object - or alternatively target a function which is common across all tabs which can then somehow get a handle to the class from that tab.
I hope I explained this well enough! It's the JS that is causing me headaches - Can I use add <script> to the view that defines the tab, and get this script to execute when I render the partial? Is there another/better way?
Thanks
Please could you advise on the best way to achieve the following in Ext.NET:
I have a tabPanel, and I add tabs when the user right-clicks on a tree node. So the tree might have 5 nodes, and the user can right-click any of these nodes and "view details tab" (all currently working with partial views).
Now, each tab that is rendered needs to have a javascript object associated with it that maintains changes which the user makes to that tab, and also responds to events on that tab such as button presses etc. So for example I have a "DetailsTab" class in JS.. I need to instantiate an instance of this class for each tab (var tabChanges = new DetailsTab()), and then when the user for example adds something using the UI, this needs to fire some code in that js class instance..
Also, I need to be able to target event handlers in my ext.net elements inside that tab. So for example if there is a "save" button then I need the <Click> listener to target the save function on my class instantiation object - or alternatively target a function which is common across all tabs which can then somehow get a handle to the class from that tab.
I hope I explained this well enough! It's the JS that is causing me headaches - Can I use add <script> to the view that defines the tab, and get this script to execute when I render the partial? Is there another/better way?
Thanks
Last edited by Daniil; Aug 08, 2011 at 1:28 PM.
Reason: [CLOSED]