[CLOSED] Advice for dynamic multiple tabs

  1. #1

    [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
    Last edited by Daniil; Aug 08, 2011 at 1:28 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please clarify how do you render a partial view?

    I guess you use .SingleControl or .ControlToRender, isn't that so?

    If so, you can place JS script into <Content> of a Panel (tab).
  3. #3
    I do use ControlToRender, so I think that will help me out.

    One more thing I think I need to be able to do with this - can you show me how to do the equivalent of loading a panel into a tab from javascript code instead of Ext.Net. For example, I have a partial view which I add to the tabPanel with:


    				<DirectEvents>
    					<Click Url="/Partial/Manage">
    						<ExtraParams>
    							<ext:Parameter Name="containerId" Value="#{tpMain}" Mode="Value" />
    						</ExtraParams>
    					</Click>
    				</DirectEvents>
    But how can I request the "Partial/Manage" page from Javascript, and then add it to a new tab?

    Thanks
  4. #4
    Please use
    Ext.net.DirectMethod.request({
        url : "/Partial/Manage",
        extraParams : { 
            "containerId" : <%= tpMain.ClientID %>
        }
    });
    Please note that we can't use <%= %> syntax within <head> tags. So, please place the script within, for <body>.

Similar Threads

  1. [CLOSED] Export To Excel with multiple tabs
    By Fahd in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Jun 25, 2012, 2:01 PM
  2. Replies: 7
    Last Post: Mar 09, 2011, 8:15 PM
  3. Replies: 1
    Last Post: Dec 06, 2010, 8:51 AM
  4. [CLOSED] Multiple UserControls, Column and Tabs
    By CMA in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jan 15, 2010, 12:09 PM
  5. Open Multiple Tabs with CheckboxSelectionModel
    By simonmicheal in forum 1.x Help
    Replies: 0
    Last Post: May 29, 2009, 12:56 PM

Posting Permissions