Ext.define('saas.view.sys.messagelog.DataList', { extend: 'Ext.grid.Panel', xtype: 'sys-messagelog-datalist', autoScroll: true, frame:true, layout:'fit', dataUrl:'http://192.168.253.58:8920/messagelog/list', saveUrl:'/api/common/number/save', deleteUrl:'/api/common/number/delete/', tbar: [{ cls:'x-formpanel-btn-orange', xtype:'button', text:'查询', listeners: { click: 'onQuery' } },'->'], //字段属性 columns : [{ text : "id", width : 0, dataIndex : "id", xtype : "numbercolumn", },{ text : "单据编号", width : 200.0, dataIndex : "ml_code", }, { text : "操作", dataIndex : "ml_content", width : 220.0, }, { text : "结果", dataIndex : "ml_result", width : 120.0, }, { text : "处理人", dataIndex : "ml_man", width : 200, }], dbSearchFields: [], condition:'', initComponent: function() { var me = this; if(me.columns){ var fields = me.columns.map(column => column.dataIndex); me.store = Ext.create('Ext.data.Store',{ fields:fields, autoLoad: true, pageSize: 10, data: [], proxy: { timeout:8000, type: 'ajax', url: me.dataUrl, actionMethods: { read: 'GET' }, reader: { type: 'json', rootProperty: 'data.list', totalProperty: 'data.total', } }, listeners: { beforeload: function (store, op) { var condition = me.condition; if (Ext.isEmpty(condition)) { condition = ""; } Ext.apply(store.proxy.extraParams, { number: op._page, size: store.pageSize, condition: JSON.stringify(condition) }); } } }); Ext.apply(me, { dockedItems:[{ xtype: 'pagingtoolbar', dock: 'bottom', displayInfo: true, emptyMsg: "暂无数据", store: me.store, displayMsg: '显示{0}到{1}条数据,共有{2}条', beforePageText: "当前第", afterPageText: "页,共{0}页" }] }); } me.callParent(arguments); }, getCondition: function(f,conditionExpression){ var condition = ''; if((f.xtype == 'checkbox' || f.xtype == 'radio')&&f.logic){ }else if(f.xtype=='textfield'&&f.value!=''){ condition=conditionExpression.replace(new RegExp("\\{0}","g"), f.value); } if(condition.length>0){ condition+= ' AND '; } return condition; }, refresh:function(){ //debugger } });