Grid Record Click Issue

January 5th, 2009
  • Hi I'm stuck on getting this problem to work:

    I have a grid in a tabpanel. If I click a record from the grid I want to open a new tab with a formpanel with all the information of that clicked record.

    I don't understand:
    - how to code : open a new tab when clicked a record
    - how to code : load/transfer the information of the clicked row into the made form(panel) which is in the new made tab.

    I suppose this is not too hard to make, but I'm new to ExtJS.
    Maybe someone can help me?

    Thanks in advance! /:)


  • greeeeaaat replies :))


  • Could it be that you're posting in the wrong forum?


  • Ok No problem I figured it out myself and like to share it.

    var grid = new Ext.grid.GridPanel
    var tabpanel = new Ext.TabPanel


    var grid = new Ext.grid.GridPanel
    [...]
    var tabpanel = new Ext.TabPanel
    [...]

    grid.getSelectionModel().on('rowselect', function(sm, rowIdx, rowobject) {
    var myTabPanel = Ext.getCmp('tabpanel'); // get the tabpanel object for adding a new tab
    addTab(myTabPanel, rowobject);
    });

    function addTab(myTabPanel, rowobject){
    myTabPanel.add({
    title: rowobject.data.company_name, // here you have your company name from the record in the datagrid
    iconCls: 'tabs',
    html: 'Tab Body',
    closable:true
    }).show();
    }


    Enjoy!







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Grid Record Click Issue , Please add it free.