Results 1 to 3 of 3

Thread: GridPanel SetID

  1. #1
    Ext User
    Join Date
    Mar 2007
    Location
    Dallas, TX
    Posts
    5

    Default GridPanel SetID

    Is there anyway to set the ID of a GridPanel? I see in the docs that several of the controls have a setID() method. But it doesn't appear to be in GridPanel.

    The problem I am having is,
    I am creating tabs on the fly based upon menu items the user clicks. Each tab has a grid in it. So I create the grid, associate it to a GridPanel and it shows up in the center region of the layout. If the user clicks the same link a second time I want to activate the existing tab and not create a new one. If I use the following code to check for existance of a tab

    Code:
    if (innerLayout.getRegion("center").getTabs().getTab(myId))
    {
    //activate it
    }
    else
    {
    //create it
    }
    it doesn't find the tab with myId because GridPanel creates it's own id's.

    The only other option I can think of is to create an array mapping myId's to GridPanel id's. But that is kind of clumsy.

    Thanks

  2. #2
    Ext User daviscabral's Avatar
    Join Date
    May 2007
    Location
    Cascavel / PR / Brazil
    Posts
    45

    Default

    To solve this, my case this is with dialogs, I used this:

    PHP Code:
    dialogs = { }
    function 
    newDialog(id) {
    var 
    dialogId "F_Dialog_"+Id;
      if (!
    dialogs[dialogId]) {                
        
    dialogs[dialogId] = new Ext.BasicDialog(NomeForm, { 
            
    autoTabs:falseautoCreate:truewidth:370,
            
    height:255resizablefalseshadow:true,
            
    dragable:trueproxyDrag:truetitle:"My New Dialog"
        
    });
      }

    To access I use: dialogs[Id].

    If you use firebug, at comando line use: newDialog('cities'); dir(dialogs['cities']);

    And you see all information about the dialog 'cities'.

  3. #3
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    You create the Grid that the GridPanel is created from in a container don't you? Give that container an id. That will be the id of the GridPanel, and therefore of the Tab.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •