0
我使用這篇文章架構http://blog.extjs.eu/know-how/writing-a-big-application-in-ext/我怎麼可以顯示網格
低於其他數據這是我的格檔
Application.DashBoardGrid = Ext.extend(Ext.grid.GridPanel, {
border:false
,fromdate:''
,todate : ''
,initComponent:function() {
var store =new Ext.data.JsonStore({
// store configs
autoDestroy: true,
autoLoad :true,
url: 'api/index.php?_command=getresellerscount&fromdate='+this.fromdate+'&todate='+this.todate,
storeId: 'getresellerscount',
// reader configs
root: 'cityarray',
idProperty: 'cityname',
fields: [
{name: 'cityname'},
{name: 'totfollowup'},
{name: 'totcallback'},
{name: 'totnotintrested'},
{name: 'totdealsclosed'},
{name: 'totcallsreceived'},
{name: 'totcallsentered'},
{name: 'totresellerregistered'},
{name: 'countiro'},
{name: 'irotransferred'},
{name: 'irodeferred'}
]
});
console.log(store);
var config = {
store:store
,columns: [
{
id :'cityname',
header : 'City Name',
width : 120,
sortable : true,
dataIndex: 'cityname'
},
{
id :'countiro',
header : ' Total Prospect',
width : 100,
sortable : true,
dataIndex: 'countiro'
,renderer : this.linkiroRenderer
},
{
id :'irotransferred',
header : 'Calls Transfered By IRO',
height : 50,
width : 100,
sortable : true,
dataIndex: 'irotransferred'
,renderer : this.linkiroRenderer
},
{
id :'irodeferred',
header : ' Calls Deferred By IRO',
width : 100,
sortable : true,
dataIndex: 'irodeferred'
,renderer : this.linkiroRenderer
},
{
id :'totcallsentered',
header : ' Total Calls Entered',
width : 100,
sortable : true,
dataIndex : 'totcallsentered',
renderer : this.linkRenderer
},
{
id :'totfollowup',
header : ' Follow Up',
width : 100,
sortable : true,
dataIndex: 'totfollowup',
renderer : this.linkRenderer
},
{
id :'totcallback',
header : ' Call Backs',
width : 100,
sortable : true,
dataIndex: 'totcallback',
renderer : this.linkRenderer
},
{
id :'totnotintrested',
header : ' Not Interested',
width : 100,
sortable : true,
dataIndex: 'totnotintrested',
renderer : this.linkRenderer
},
{
id :'totdealsclosed',
header : ' Deals Closed',
width : 100,
sortable : true,
dataIndex: 'totdealsclosed',
renderer : this.linkRenderer
},
{
id :'totresellerregistered',
header : ' Reseller Registered',
width : 100,
sortable : true,
dataIndex: 'totresellerregistered',
renderer : this.linkRenderer
}
]
,plugins :[]
,viewConfig :{forceFit:true}
,tbar :[]
,bbar :[]
,height : 350
,width : 1060
,title : 'Reseller Dashboard'
}; // eo config object
// apply config
Ext.apply(this, Ext.apply(this.initialConfig, config));
Application.DashBoardGrid.superclass.initComponent.apply(this, arguments);
} // eo function initComponent
/**
* It is the renderer of the links of cell
* @param data value of cell
* @param record object of data has all the data of store and record.id is unique
**/
,linkRenderer : function (data, cell, record, rowIndex, columnIndex, store) {
var tag={
tag: 'a',
href: '#',
html: data//,
// onclick: this.resellerWindow(record.data.cityname,cell.id)
};
if (data != null) {
return '<a href="javascript:void(0)" onclick="resellerwindow(\'' +record.data.cityname+'\',\''+cell.id+'\',\''+this.header+'\')">'+ data +'</a>';
}
return data;
}
/**
* It is the renderer of the links iro's column of cell
* @param data value of cell
* @param record object of data has all the data of store and record.id is unique
**/
,linkiroRenderer : function (data, cell, record, rowIndex, columnIndex, store) {
// console.log(this.header);
if (data != null) {
return '<a href="javascript:void(0)" onclick="resellerirowindow(\'' +record.data.cityname+'\',\''+cell.id+'\',\''+this.header+'\')">'+ data +'</a>';
}
return data;
}
,resellerwindow : function (cityname,columndataindex) {
var win = new Ext.Window({
items:{
xtype : 'ResellerGrid',
'cityname' : cityname,
'columndataindex' : columndataindex
}
});
win.show();
}
,onRender:function() {
// this.store.load();
Application.DashBoardGrid.superclass.onRender.apply(this, arguments);
} // eo function onRender
});
Ext.reg('DashBoardGrid', Application.DashBoardGrid);
這是我的JSON返回
{
"countothercities": "1",
"directreseller": "24",
"totalresellersregisteredfor8cities": 23,
"cityarray": [{
"cityname": "bangalore",
"totfollowup": "2",
"totcallback": "3",
"totnotintrested": "1",
"totdealsclosed": "0",
"totcallsreceived": "0",
"totcallsentered": "88",
"totresellerregistered": "4",
"countiro": "156",
"irotransferred": "130",
"irodeferred": "26"
}
}
如何我可以顯示
「countothercities」:「1」, 「direc treseller「:」24「, 」totalresellersregisteredfor8cities「:23,
下面的網格?
不錯的變量值來了,我怎麼可以把他們的網格下,我可以把 – XMen 2011-03-22 10:57:35
底部欄即將空白BBAR,爲什麼你的使用狀態'ref'和您指定給狀態? – XMen 2011-03-22 11:16:33
糟糕 - 抱歉遺漏了'setText()'。我修復了示例代碼。此代碼使用Ext組件中的'ref'-概念,它允許您在適當的容器上註冊組件的屬性。這就是爲什麼我們可以使用'toolbar.status'來訪問我們的文本項目組件。 – 2011-03-22 11:19:51