Results 1 to 4 of 4

Thread: Open a new tab by clicking a cell in the grid

  1. #1
    Ext User
    Join Date
    Mar 2009
    Location
    Russia
    Posts
    19

    Default Open a new tab by clicking a cell in the grid

    Hi!
    I have a TabPanel with dynamically created grids in tabs. Grids are created using the method from the documentation. So I have a function addTab:
    Code:
    function addTab(tabName){
            Ext.Ajax.request({
                url: 'rpc.php',
                params: {task: tabName},
                success: function(xhr) {
                    var newComponent = eval(xhr.responseText);
                    tabPanel.add(newComponent);
                    tabPanel.setActiveTab(newComponent);
                },
                failure: function() {
                    Ext.Msg.alert('Error', 'Server communication failure');
                }
            });
        }
    But I can't call this function from the newly created grid because I can't pass the context to the grid. I tried this code but with no luck:
    Code:
    (function(this) {
    var grid; // ...
    }
    How can I call addTab()?

  2. #2
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


  3. #3
    Ext User
    Join Date
    Mar 2009
    Location
    Russia
    Posts
    19

    Default

    Thanks, but this example doesn't show how to create tabs from the context of grids. I suppose that method from the documentation is too simple and actually doesn't give an ability to create tabs as I want. The architecture of the web app should be different, but I still can't understand what I should do...

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

    Default

    's the difference? There is no such thing as a "context of grids". Adding a tab (You don't creats "tab"s, you create a Component and add it to a TabPanel) is adding a 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
  •