PDA

View Full Version : how to display list object



satya1974
11 Apr 2011, 4:44 AM
I have a gridA to display and clicking on one column I want to open form panel which displays another gridB. To display this second grid i have alredy have my json object (list object) inside my gridA. request you all to please help me how to display gridB with list object of GridA.

Screamy
11 Apr 2011, 6:26 AM
If the Store which backs gridA and gridB has the same field structure, it's as simple as the code shown below. This works also in the case where singleSelect is true in gridA:




var arrayOfSelectedRecords = gridA.selModel.getSelections();
gridB.store.add(arrayOfSelectedRecords);

satya1974
11 Apr 2011, 6:50 AM
No they are different field structures

Screamy
11 Apr 2011, 11:19 AM
Visit the API docs for Ext.data.Record.create(). The provided code sample shows how to correctly create a new record for a store and populate it via JSON.