PDA

View Full Version : Creating new grid bases on selection of records from existing grid



jessie143143
9 Apr 2014, 8:42 PM
Hi can any one help me with this requirment.I have a grid with with checkbox and based on selection of records i should create a new grid. Assume that i have a first grid with 10 records and i have selected two records with this two records i need to create a new grid.For that iam creating a new store by copying selected records like this.


var records = []; store.each(function(r){ records.push(r.copy()); }); var store2 = new Ext.data.Store({ recordType: store.recordType }); store2.add(records);The issue is iam getting an error like proxy is undefined.

ronaldmojica
9 Apr 2014, 9:44 PM
in your store definition try to setup a proxy like setting it up as a json with a dummy url..



var myStore = Ext.create('Ext.data.Store', {
model: 'User',
proxy: {
type: 'ajax',
url: '/users.json',
reader: {
type: 'json',
root: 'users'
}
},
autoLoad: true
});