hibernate3-SpringMVC+hibernate4+Extjs4.2+mysql
來源:懂視網(wǎng)
責(zé)編:小采
時(shí)間:2020-11-09 16:32:52
hibernate3-SpringMVC+hibernate4+Extjs4.2+mysql
hibernate3-SpringMVC+hibernate4+Extjs4.2+mysql:mysqlhibernate3springmvcextjs4 2 后臺處理數(shù)據(jù)庫數(shù)據(jù)(讀取數(shù)據(jù)) @RequestMapping(/getmanagers)@ResponseBodypublic Map getWorkOrders(String page,String limit,String start,String all){ i
導(dǎo)讀hibernate3-SpringMVC+hibernate4+Extjs4.2+mysql:mysqlhibernate3springmvcextjs4 2 后臺處理數(shù)據(jù)庫數(shù)據(jù)(讀取數(shù)據(jù)) @RequestMapping(/getmanagers)@ResponseBodypublic Map getWorkOrders(String page,String limit,String start,String all){ i
mysqlhibernate3springmvcextjs4 2
- 后臺處理數(shù)據(jù)庫數(shù)據(jù)(讀取數(shù)據(jù))
@RequestMapping("/getmanagers")@ResponseBodypublic Map getWorkOrders(String page,String limit,String start,String all){ int pageInt = Integer.parseInt(page); int limitInt = Integer.parseInt(limit); int startInt = Integer.parseInt(start); Map map = new HashMap(); List list = workOrdersService.getWorkOrders(); List listTemp ; //數(shù)據(jù)庫中的結(jié)果條數(shù)小于分頁限制,則直接返回結(jié)果 map.put("total",list.size()); if(list.size()<=limitInt){ map.put("workOrders", list); return map; } if(all!=null){ map.put("workOrders", list); return map; } //截取List if(pageInt*limitInt>=list.size()){ listTemp = list.subList(startInt, list.size()); }else{ listTemp = list.subList(startInt, pageInt*limitInt); } map.put("workOrders", listTemp); return map;}
- ExtMVC
中的model
Ext.define('tw.model.GlobalStatisticsModel',{
extend : 'Ext.data.Model',
fields: [
{name: 'id', type: 'int',sortType :'aesc'},
{name: 'failuretime',type: 'date'},
{name: 'failureaddress', type: 'string'},
{name: 'repairtime', type: 'string'},
{name: 'maintenanceman', type: 'string'},
{name: 'completion', type: 'string'},
{name: 'failurecontent', type: 'string'}
]
});
中的store
Ext.define('tw.store.GlobalStatisticsStore',{
extend:'Ext.data.Store',
model:'tw.model.GlobalStatisticsModel',
pageSize: 17,
proxy:{
type:'ajax',
url: 'gdgl/getmanagers',
reader: {
type: 'json',
root: 'workOrders'
},
writer:{
type: 'json'
}
},
autoLoad: true
});
然后是Ext的View
Ext.define('tw.view.gdgl.GlobalStatisticsView',{
extend : 'Ext.grid.Panel',
xtype : 'globalStatisticsView',
store:'GlobalStatisticsStore',
selType : 'checkboxmodel',
forceFit:false,
columns: [{
text: 'ID',
dataIndex: 'id',
width:50,
editor: {
readOnly:true
}
}, {
// text: '故障時(shí)間',
header:'故障時(shí)間',
dataIndex: 'failuretime',
width:180,
renderer : Ext.util.Format.dateRenderer('Y-m-d H:i:s'),
editor: {
allowBlank: false
}
}, {
text: '故障地點(diǎn)',
dataIndex: 'failureaddress',
width:200,
editor: {
allowBlank: false
}
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
hibernate3-SpringMVC+hibernate4+Extjs4.2+mysql
hibernate3-SpringMVC+hibernate4+Extjs4.2+mysql:mysqlhibernate3springmvcextjs4 2 后臺處理數(shù)據(jù)庫數(shù)據(jù)(讀取數(shù)據(jù)) @RequestMapping(/getmanagers)@ResponseBodypublic Map getWorkOrders(String page,String limit,String start,String all){ i