版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/inforstack/article/details/46754723
Ext.define('ScreeningModelVo', {
extend: 'Ext.data.Model',
fields: [
{name: 'id', type: 'string'},
{name: 'name', type: 'string'}
]
});
this.store = Ext.create('Ext.data.Store', {
autoLoad : true, //自动加载store
model : 'ScreeningModelVo',
remoteSort : true, //服务端排序
proxy : {
type : 'ajax',//请求类型
url : '/subscriber/model/list',
reader : {
type : 'json',//数据类型
root : 'data' //json数据中的data,例如 {"success":1,"message":"","data":[{"id":"1001","name":"张三"}]}
},
simpleSortMode : true //单个字符进行排序
}
});
var get_model_grid = Ext.create('Ext.grid.Panel', {
width: 150,
height: 300,
border : true,
margin : '5 5 5 5', //边距
store: this.store, //引用store
emptyText: '无数据',
hideHeaders: true, //是否隐藏标题
columns: [{
header: "模型名称",
dataIndex : "nameZH",
flex : 1
}],
listeners : {
scope : this,
celldblclick : this._rightShift_
}
});