PDA

View Full Version : Grid nesting inside it for shorting



chandan.behura
15 Nov 2012, 8:28 AM
Hi,

for click of a button i am adding a panel to a container and the adding a grid to that panel with updated store.
but on click of that button for 2nd time after refresh the page when i an shorting any column of that grid then the same grid coming in that grid itself repeatedly.


onClickShowSummaryGrid : function() {

var filterController = appReference.getController('customerFreightChargesSummary.CFCSummaryFilterController');
var summaryPanel = Ext.widget('summarypanel');
var summaryGrid = Ext.widget('summarygrid');
//this.getCfcSummaryContainerPanel().remove();
this.getCfcSummaryContainerPanel().add(summaryPanel);
summaryPanel.setLoading(true,true);
this.selectedSCProcessed = [];
this.selectedSTCProcessed = [];
if(filterController.selectedSC.length==filterController.maxSC){
filterController.selectedSCProcessed.push("'"+'All'+"'");
}
else{
this.getCustomerFreightChargesShippingConditionStoreStore().queryBy(function(record) {
for(var SCindex=0;SCindex<filterController.selectedSC.length;SCindex++){
if(record.get('shippingConditionValue') === filterController.selectedSC[SCindex]){
filterController.selectedSCProcessed.push("'"+record.get('shippingConditionCd')+"'");
}
}
});
}
if(filterController.selectedSTC.length==filterController.maxSTC){
filterController.selectedSTCProcessed.push("'"+'All'+"'");
}
else{
this.getCustomerFreightChargesShipToCountryStoreStore().queryBy(function(record) {
for(var STCindex=0;STCindex<filterController.selectedSTC.length;STCindex++){
if(record.get('shipToCountryValue') === filterController.selectedSTC[STCindex]){
filterController.selectedSTCProcessed.push("'"+record.get('shipToCountryCd')+"'");
}
}
});
}


filterController.timeFrameType = Ext.getCmp('timeframe').getValue();
filterController.timeFrameFrom = "'"+Ext.getCmp('fromComboId').getValue()+"'";
filterController.timeFrameTo = "'"+Ext.getCmp('toComboId').getValue()+"'";
var resultgrid = this.getCustomerFreightChargesSummaryGridStoreStore();

resultgrid.load({
params : {
shippingCondition : filterController.selectedSCProcessed,
shipToCountry : filterController.selectedSTCProcessed,
timeFrameType : filterController.timeFrameType,
timeFrameFrom : filterController.timeFrameFrom,
timeFrameTo : filterController.timeFrameTo
},
scope:this,
callback: function(records, operation, success) {
summaryPanel.setLoading(false,false);
resultgrid.setProxyParameters(filterController.selectedSCProcessed, filterController.selectedSTCProcessed, filterController.timeFrameType,filterController.timeFrameFrom,filterController.timeFrameTo);
if(resultgrid.count()>0){
this.getCfcSummaryContainerPanel().getComponent('summarypanel').removeAll();
this.getCfcSummaryContainerPanel().getComponent('summarypanel').add(summaryGrid);
Ext.getCmp('CFCSettingId').enable(true);
Ext.getCmp('CFCPrinterId').enable(true);
Ext.getCmp('CFCDownloadId').enable(true);
}
else{
Ext.getCmp('CFCSettingId').disable(true);
Ext.getCmp('CFCPrinterId').disable(true);
Ext.getCmp('CFCDownloadId').disable(true);
Ext.getCmp('displayID').setValue('<span style="color:red;font-size:15px">'+"<b>No Data To Display</b>"+'</span>');
}
}
});





},

mitchellsimoens
19 Nov 2012, 8:42 AM
I'm not sure what you are describing what you want to do