PDA

View Full Version : problem in loading data in grid



amanind
13 Aug 2010, 6:07 AM
Hi,

I am not able to load data into grid, let me know where I am doing wrong

here is my code


initComponent: function() {

var sm = new Ext.grid.CheckboxSelectionModel();
var store = new Ext.data.Store({
data:[],
reader: new Ext.data.JsonReader({id: '_id'}, MS.ImpactSisterApp.GridRecord )
});
grid2 = new Ext.grid.GridPanel({
store: store,
columns: [
{id:'fund',header: "Fund", width: 150, renderer: this.showFundData, dataIndex: 'fund'},
{header: "Region", width: 150, renderer: this.showRegionData, dataIndex: 'region'},
{header: "Investment", width: 300, renderer: this.showInvestData, dataIndex: 'investment'},
sm
],
sm: sm,
enableHdMenu: false,
enableColumnMove: false,
enableColumnResize: false,
width:680,
height:270,
frame:true,
viewConfig: {
enableRowBody: true
},
stripeRows: true,
iconCls:'icon-grid'
});


var config = {
frame: true,
timeout: 60000,
hideBorders: true,
header: false,
layout: 'table',
layoutConfig: {
columns: 2
},

items: [
{
xtype: 'panel',
width: 730,
colspan:4,
height: 10
}, {
items: [{
layout:'column',
width: 730,
items:[ grid2]
}]
}]
};
Ext.apply(this, Ext.apply(this.initialConfig, config));
MS.ImpactSisterApp.BPDataDumpPanel.superclass.initComponent.apply(this, arguments);
pdfExcelCombo.setValue(MS.ImpactSisterApp.config.comboDataTypes.pdfOrExcelType[0].Name);
pdfExcelCombo.on("select", this.setPdfOrExcelType,this);
this.on('render', this.onPanelRender, this);
},

loadInvestGrid: function() {
var data = arguments[0].reportData;
grid2.getStore().loadData(data);
},
onDestroy: function(){

this.reportingPeriodData = null;
this.un('render', this.onPanelRender, this);
}
});
MS.ImpactSisterApp.InvestmentAssetModelsPanel.prototype.showFundData = function(value, meta, rec) {
debugger
}
MS.ImpactSisterApp.InvestmentAssetModelsPanel.prototype.showRegionData = function(value, meta, rec) {
}
MS.ImpactSisterApp.InvestmentAssetModelsPanel.prototype.showInvestData = function(value, meta, rec) {
}

evant
15 Aug 2010, 4:56 PM
You've only provided half of the picture here. What does your data look like?