Ext问题 我用的Store和GridPanel 来显示数据,后台能输出结果,数据是多条的 他只显示最后一条信息!代码:
//财收四数据仓库varCs4Store=newExt.data.Store({id:'Cs4Store',proxy:newExt.data.HttpProxy({ap...
//财收四数据仓库
var Cs4Store = new Ext.data.Store({
id : 'Cs4Store',
proxy :new Ext.data.HttpProxy({
api : {
read : "../../auditxb_gg_json/Cs4SumAddView.action?dbm="+dbm+"&accountdate="+Accountdate1+"&blflag=0&xbType="+ntype+"&Windownum="+Windownum
}
}),
reader : new Ext.data.JsonReader(
{
root : 'root'
},
[
{name:'id'},
{name: 'Ticketflag'},
{name: 'Windownum'},
{name: 'Startnum'},
{name: 'Endnum'},
{name: 'Accountdate'},
{name: 'Sheetnum'},
{name: 'Obsoletenum'},
{name: 'Sendnum'},
{name: 'Ticketno'},
{name: 'Totalnum'},
{name: 'Totalweight'},
{name: 'Titlemoney',type: 'float' },
{name: 'statflag',type: 'number'},
{name: 'alreadynum', type: 'number'},
{name:'Stationdbm'},
{name:'Stationname'},
{name:'cs4typeid' }
])
});
//财收四展示模式
var Cs4Cm = new Ext.grid.ColumnModel([
{header:"票据类型",sortable:true,resizable:true,dataIndex:"cs4typeid",width:60,renderer : function(_v) {if (_v == "1") {return "行李";}else if(_v=="2") {return "包裹" ;} else {return "其它";}}},
{header:"结帐日期",sortable:true,resizable:true,dataIndex:"Accountdate",width:60},
{header:"发站",sortable:true,resizable:true,dataIndex:"Stationname",width:40},
{header:"窗口号",sortable:true,resizable:true,dataIndex:"Windownum",width:60,renderer : function(_v) {if (_v == "0") {return "";} else {return _v;}}},
{header:"票符",sortable:true,resizable:true,dataIndex:"Ticketflag",width:40},
{header:"票据起号",sortable:true,resizable:true,dataIndex:"Startnum",width:80},
{header:"票据止号",sortable:true,resizable:true,dataIndex:"Endnum",width:80},
{header:"总张数",sortable:true,resizable:true,align: 'right',dataIndex:"Sheetnum",width:60},
{header:"作废张数",sortable:true,resizable:true,align: 'right',dataIndex:"Obsoletenum",width:100},
{header:"已补张数",sortable:true,resizable:true,align: 'right',dataIndex:"alreadynum",width:100,renderer : function(_v) {return '<span style="color:red;">' + _v + '</span>' ;}},
{header:"总件数",sortable:true,resizable:true,align: 'right',dataIndex:"Totalnum",width:60},
{header:"总重量",sortable:true,resizable:true,align: 'right',dataIndex:"Totalweight",width:60},
{header:"总金额(元)",sortable:true,resizable:true,align: 'right',dataIndex:"Titlemoney",width:100}
]);
/*财收四视图*/
var Cs4Grid = new Ext.grid.GridPanel({title : '',id : 'feeGrid',
store : Cs4Store,
cm : Cs4Cm,
width:600,
listeners : {
'render' : function(node, c) {
Cs4Store.load() ;
}
}
}); 展开
var Cs4Store = new Ext.data.Store({
id : 'Cs4Store',
proxy :new Ext.data.HttpProxy({
api : {
read : "../../auditxb_gg_json/Cs4SumAddView.action?dbm="+dbm+"&accountdate="+Accountdate1+"&blflag=0&xbType="+ntype+"&Windownum="+Windownum
}
}),
reader : new Ext.data.JsonReader(
{
root : 'root'
},
[
{name:'id'},
{name: 'Ticketflag'},
{name: 'Windownum'},
{name: 'Startnum'},
{name: 'Endnum'},
{name: 'Accountdate'},
{name: 'Sheetnum'},
{name: 'Obsoletenum'},
{name: 'Sendnum'},
{name: 'Ticketno'},
{name: 'Totalnum'},
{name: 'Totalweight'},
{name: 'Titlemoney',type: 'float' },
{name: 'statflag',type: 'number'},
{name: 'alreadynum', type: 'number'},
{name:'Stationdbm'},
{name:'Stationname'},
{name:'cs4typeid' }
])
});
//财收四展示模式
var Cs4Cm = new Ext.grid.ColumnModel([
{header:"票据类型",sortable:true,resizable:true,dataIndex:"cs4typeid",width:60,renderer : function(_v) {if (_v == "1") {return "行李";}else if(_v=="2") {return "包裹" ;} else {return "其它";}}},
{header:"结帐日期",sortable:true,resizable:true,dataIndex:"Accountdate",width:60},
{header:"发站",sortable:true,resizable:true,dataIndex:"Stationname",width:40},
{header:"窗口号",sortable:true,resizable:true,dataIndex:"Windownum",width:60,renderer : function(_v) {if (_v == "0") {return "";} else {return _v;}}},
{header:"票符",sortable:true,resizable:true,dataIndex:"Ticketflag",width:40},
{header:"票据起号",sortable:true,resizable:true,dataIndex:"Startnum",width:80},
{header:"票据止号",sortable:true,resizable:true,dataIndex:"Endnum",width:80},
{header:"总张数",sortable:true,resizable:true,align: 'right',dataIndex:"Sheetnum",width:60},
{header:"作废张数",sortable:true,resizable:true,align: 'right',dataIndex:"Obsoletenum",width:100},
{header:"已补张数",sortable:true,resizable:true,align: 'right',dataIndex:"alreadynum",width:100,renderer : function(_v) {return '<span style="color:red;">' + _v + '</span>' ;}},
{header:"总件数",sortable:true,resizable:true,align: 'right',dataIndex:"Totalnum",width:60},
{header:"总重量",sortable:true,resizable:true,align: 'right',dataIndex:"Totalweight",width:60},
{header:"总金额(元)",sortable:true,resizable:true,align: 'right',dataIndex:"Titlemoney",width:100}
]);
/*财收四视图*/
var Cs4Grid = new Ext.grid.GridPanel({title : '',id : 'feeGrid',
store : Cs4Store,
cm : Cs4Cm,
width:600,
listeners : {
'render' : function(node, c) {
Cs4Store.load() ;
}
}
}); 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询