0
votes

my setup: i have a file1 which is a Form Panel defined. I have another file2 which creates the form panel from the file1 and open it in a new Window.

My question now is it possible to transfer datas to the new opened window? In my case, i have a grid panel in file1. Now when i select one of the rows from the grid, i will transfer these data to the new window when i click a button. In my new window the Form will shown the datas from the grid panel for editing.

1

1 Answers

2
votes

if you have a grid and want to open one record in a window, you would do sth like:

itemdblclick:function(grid,record,item) {
    Ext.create('MyWindow',{
        record:record // here, you set window.record = clicked record
    });
}

and

Ext.define('MyWindow',{
    items:[{
        xtype:'form',
        items:[{
            ...
        }]
    }],
    listeners:{
        beforerender:function(window) {
            // here, you load window.record into the form!
            if(window.record) window.down('form').loadRecord(window.record);
        }
    }
});