//简历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();});