87,904
社区成员
发帖
与我相关
我的任务
分享
Ext.define('WLCSP.ERP.models.CompanyModel',{
extend:'Ext.data.Model',
fields:[
{name:'AutoID',type:'int'},
{name:'CompanyNO',type:'string'},
{name:'CompanyName',type:'string'},
{name:'Tel',type:'string'},
{name:'Address',type:'string'},
{name:'AddressEng',type:'string'},
{name:'Postcode',type:'string'},
{name:'Remark',type:'string'},
{name:'Creator',type:'string'},
{name:'CreatedTime',type:'datetime'},
{name:'DeletedBy',type:'string'},
{name:'DeletedTime',type:'datetime'},
{name:'Deleted',type:'boolean'}
]
});
Ext.define('WLCSP.ERP.stores.CompanyStore',{
extend : 'Ext.data.Store',
singleton : true,
requires : ['WLCSP.ERP.models.CompanyModel'],
model : 'WLCSP.ERP.models.CompanyModel',
constructor : function() {
this.callParent(arguments);
this.loadData([]);
},
proxy: {
type: 'ajax',
url: 'listCompany.action',
reader: {
type: 'json',
root: 'companylist',
successProperty: 'success'
}
},
autoLoad: false
});
Ext.define('WLCSP.ERP.views.CompanysGridPanel', {
extend : 'Ext.grid.Panel',
alias : 'widget.CompanysGridPanel',
requires : ['WLCSP.ERP.stores.CompanyStore'],
initComponent : function() {
this.store = WLCSP.ERP.stores.CompanyStore; // grid组件的store已经固定,但需要通过一些查询条件查不同的数据,通过当前的store:WLCSP.ERP.stores.CompanyStore
this.columns = this.buildColumns();
this.callParent();
},
buildColumns : function() {
return [{header:'AutoID',dataIndex : 'AutoID',hidden:true},
{header:'CompanyNO',dataIndex : 'CompanyNO',width: 70},
{header:'CompanyName',dataIndex:'CompanyName',width: 70},
{header:'Tel',dataIndex:'Tel',width:70},
{header:'Address',dataIndex:'Address',width:70},
{header:'AddressEng',dataIndex:'AddressEng',width:70},
{header:'Postcode',dataIndex:'Postcode',width:70},
{header:'Remark',dataIndex:'Remark',width:70},
{header:'Creator',dataIndex:'Creator',width:70},
{header:'CreatedTime',dataIndex:'CreatedTime',width:70},
{header:'DeletedBy',dataIndex:'DeletedBy',width:70},
{header:'DeletedTime',dataIndex:'DeletedTime',width:70},
{header:'Deleted',dataIndex:'Deleted',width:70}];
}
});
//数据源提取数据
dsMaterialOutsourcingList.proxy = new Ext.data.HttpProxy({
url:'MaterialOutsourcingData.jsp?DbType=SearchLoad&PN=' + Ext.getCmp("txt_pn_materialoutsourcingsearch_id").getValue()
});
dsMaterialOutsourcingList.load({params : {start : 0,limit : 30}});