extjs创建grid



//简历model
 Ext.define('bdinfo', {
     extend: 'Ext.data.Model',
     fields: [
         {name: 'policy_no', type: 'string'},
         {name: 'plate_number',  type: 'string'},
         {name: 'insured',       type: 'string'},
         {name: 'issue_date',  type: 'string'},
         {name: 'inception_date',  type: 'string'},
         {name: 'planned_end_date',  type: 'string'}
     ]
 })
 
//store 加载数据
var myStore = Ext.create('Ext.data.Store', {
     model: 'bdinfo',
     proxy: {
         type: 'ajax',
         url: '../../cmi/groupAction.ered?reqCode=selectTBinfo&unlogin=1&idcard='+idcard,
         reader: {
             type: 'json',
             root: 'bdinfo'
         }
     },
     autoLoad: true
 });
 //定义列字段名
var infocolumns = [Ext.create('Ext.grid.RowNumberer',
 {text : 'NO',align : 'center',maxWidth : 40,minWidth : 40})
,{header : '保单号',dataIndex : 'policy_no',id:'policy_no', sortable : true}
,{header : '车牌号',dataIndex : 'plate_number',id:'plate_number', sortable : true}
,{header : '被保险人',dataIndex : 'insured',id:'insured', sortable : true}
,{header : '签单日期',dataIndex : 'issue_date',id:'issue_date', sortable : true}
,{header : '起保日期',dataIndex : 'inception_date',id:'inception_date', sortable : true}
,{header : '止保日期',dataIndex : 'planned_end_date',id:'planned_end_date', sortable : true}
 
]; 、
//创建grid
var infogrid =  Ext.create('Ext.grid.Panel', {
region : 'center', 
border : true, 
iconCls : 'applicationIcon', 
scroll : 'both', 
store : myStore, 
multiColumnSort : true, 
viewConfig: {stripeRows : true}, 
columns : infocolumns, 
scrollable : 'x',
scrollable : 'y',
forceFit  : true
}); 
//加载grid
   var appinfowin = Ext.create('Ext.window.Window', { 
    title:'用户保单信息',  
bodyStyle : 'background-color:#FFFFFF', 
modal : true, 
id : 'id_appwin',
layout : 'fit', 
height : 540,
width : 960,
maximized : false,
draggable : true, 
constrain : true, 
border : false,
frame : false, 
 items : [infogrid] 
}); 
appinfowin.show();
appinfowin.addListener('restore', function(window) {window.center();});
appinfowin.addListener('close', function(window) {store.load();window.destroy();});
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值