1

I have grid data in ExtJS. I've decided to insert a new tab whenever the user clicks on a specific row. The new tab contains information which has been transmitted from a row.

Here is my code:

columns: [
    {
        text: 'Name',
        dataIndex: 'name',
        flex: 2,
        items: [
            {
                xtype: 'searchtrigger',
                autoSearch: true
            }
        ]
    }, 
    {
        text: 'Price',
        dataIndex: 'price',
        flex: 1
    }
],
bbar: {
    xtype: 'pagingtoolbar',
    displayInfo: true,
    displayMsg: 'Displaying {0} to {1} of {2}  records ',
    emptyMsg: "No records to display "
},
listeners: {
    select: function (tabPanel, newTab, oldTab, eOpts) {
        tabPanel.add({
            title: 'sometitle'
        });
    }
}

However, in the first step, I've got an error:

Uncaught TypeError: tabPanel.add is not a function

By the way, I have a couple of questions:

1- What is the best practice for transmitting data between two views in ExtJS?

2- Any suggestion to resolve the above issue?

EDITED: Here is the fiddle:

Philipp Maurer
  • 2,480
  • 6
  • 18
  • 25
Farzan Najipour
  • 2,442
  • 7
  • 42
  • 81

0 Answers0