简体   繁体   中英

EXTJS 4.2 : Copy Selected Gridrows from One grid to another Grid in a new Window on button click

I have a Grid Panel which has a checkcolumn as its selection model and a few rows. I need to have a model where in on a buton click, a new window opens containing a grid wherein all the selected rows from the previous grid appear .

How do I go about achieving this? I have tried loading the rows into a new Store and passing this store to the new Grid. Also a store to store transfer of data seems infeasible?

You can pass value to new created component. So you can use passed value for load the store.

basicly you can pass value to your custom component like this;

Ext.create('AppName.yourCustomComponent',{
     yourCustomField : yourCustomValue
});

And you can handle this passed data in your custom component like this;

Ext.define('AppName.yourCustomComponent', {
    extend : 'Ext.window.Window', //in your stuation
    initComponent : function(){
        alert(this.yourCustomField);  // your custom value here 
        this.callParent( arguments );
    }
});

I also tried to implement your problem at the fiddle here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM