mercredi 15 octobre 2014

grid loads only when there is just 1 record

I have 1 grid/store that has checkcolumns and I let the user check the records that will be updated, when the user selects only one record (any one), then the next grid shows the record with no issues, when the user selects any two records, I do not get any records displayed in my grid.

I am upgrading from Ext3 to Ext5 if that makes a difference.


Thanks for any help..


** Also I posted this in discussion, I could not figure how to move it.



Code:



if (button.getId() == 'btn_21E_Submit') { Ext.getCmp('btn_21E_Submit').disable();
gp12.getStore().removeAll();
gp21.getStore().each(function(record){
var rowData = record.data;
if (record.get('gp21select')) {
console.log(gp12Store.getCount());
console.log(rowData);
gp12Store.add(record.data);
console.log(gp12Store.getCount());
};
})

}

Here is my code for..

Model



Code:



// Set up a model to use in our Store
Ext.define('modgp12', {
extend: 'Ext.data.Model',
fields: [
{Id: null},
'TAXID',
'LISTNUM',
'LEGALNAME',
'DBA',
'LOCATION',
'ADDRESS1',
'ADDRESS2',
'CITY',
'STATE',
'ZIP',
'DBA-MULTI-LINE',
'TAXIDLISTNUM',
'MESSAGE'
]
});

Store:


Code:



// Selected Property Listings
var gp12Store = Ext.create('Ext.data.JsonStore', {
model: 'modgp12',
storeId: 'gp12Store',
autoLoad: false,
proxy: new Ext.data.HttpProxy({
url: pgmName,
actionMethods: {
create : 'POST',
read : 'POST',
update : 'POST',
destroy: 'POST'
},
extraParams: {
action: 'load_CListing'
},
reader: {
type: 'json',
rootProperty: 'Clisting'
}
}),
listeners: {
beforeload: function(store){
store.getProxy().extraParams.TaxID = Ext.getCmp('fld_0L_TAXID').getValue();
store.getProxy().extraParams.ListNum = Ext.getCmp('fld_0L_LISTNUM').getValue();
store.getProxy().extraParams.Session = Ext.getCmp('fld_0L_Session').getValue();
}
}
});

Grid


Code:



var gp12 = Ext.create('Ext.grid.Panel', {
id: 'gp12',
store: gp12Store,
region: 'center',
title: 'These are the business(es) for whom you are requesting an extention',
frame: true,
width: 800,
loadMask: true,
autoScroll: true,
stripeRows: true,
trackMouseOver: true,
height: 200,
viewConfig: {
forceFit: true
},
columns: [{
header: 'Business Name',
width: 180,
dataIndex: 'LEGALNAME'
},{
header: 'DBA',
width: 180,
dataIndex: 'DBA-MULTI-LINE'
},{
header: 'Physical Location',
width: 180,
dataIndex: 'LOCATION'
},{
header: ' ID',
width: 90,
dataIndex: 'TAXID'
},{
header: 'Listing<br>Number',
width: 50,
dataIndex: 'LISTNUM'
},{
header: 'Pending<br>Extension Date',
width: 100,
dataIndex: 'PENDEXTENSIONDATE'
}]
});






grid loads only when there is just 1 record

Aucun commentaire:

Enregistrer un commentaire