Ext.onReady(function() { var jsonRecord = Ext.data.Record.create([ { name: 'A00', mapping: 'A00', type: 'string' }, { name: 'ID', mapping: 'ID', type: 'string' }, { name: 'A0101', mapping: 'A0101', type: 'string' }, { name: 'Sex', mapping: 'Sex', type: 'string' } ]); var store = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ url: '/rmyn/paste.do?template=/GBYNRYData/data/RYYNGrid.htm', timeout: 10000 }), reader: new Ext.data.JsonReader({ id: 'id', totalProperty: 'totalCount', root: 'topics' }, jsonRecord ), remoteSort: false }); store.load(); var gridview = new Ext.grid.GridView({ sortAscText: "升序", sortDescText: "降序", columnsText: "列" }); var sm = new Ext.grid.CheckboxSelectionModel({ singleSelect: true }); var colModel = new Ext.grid.ColumnModel([ new Ext.grid.RowNumberer() , sm, { name: 'ID' , header: '编号' , dataIndex: 'ID' , sortable: true , hidden: true }, { name: 'A00' , header: '人员编号' , dataIndex: 'A00' , sortable: true , hidden: true }, { name: 'A0101' , header: '姓名' , dataIndex: 'A0101' , sortable: true }, { header: '性别' , dataIndex: 'Sex' , sortable: true } ]) var comboYN = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ url: '/RMYN/Paste.do?template=/GBYNRYData/data/YNPersonCombo.htm', timeout: 10000 }), reader: new Ext.data.JsonReader({ id: 'id', totalProperty: 'total', root: 'Rows' }, [ { name: 'Dmcod', mapping: 'Dmcod' }, { name: 'state', mapping: 'DmCpt' } ]) , remoteSort: false }); colModel.defaultSortable = true; var comboObj = { xtype: "combo", store: comboYN, width: 150, name: "Combostate", id: "Combostate", valueField: "Dmcod", emptyText: '请选择酝酿状态', defaultText: '待酝酿', defaultValue: 'A121', editable: false, anchor: "95%" , onSelect: function(record) { this.setValue(record.get("Dmcod")) Ext.getCmp('Combostate').setValue(record.get("Dmcod")) this.collapse() } } var grid = new Ext.grid.GridPanel({ id: 'grid' , layout: 'fit' , store: store , cm: colModel , sm: sm , frame: true , loadMask: true , footer: true , autoScroll: true , autoShow: true , view: gridview , tbar: [ '->', { text: "修改酝酿人员状态" }, comboObj, { text: '保存' , iconCls: 'btSave' , handler: function() { if (grid.getSelectionModel().getSelections().length == 0) { Ext.Msg.alert("提示", "您没有选中任何记录!"); return; } var id = grid.getSelectionModel().getSelections()[0].get("ID"); var zhuangtai = Ext.getCmp("Combostate").getValue(); if (zhuangtai == "") { Ext.Msg.alert("提示", "请选择人员的酝酿状态!"); return; } window.grid.store.reload({ params: { start: 0, limit: 20, id: id, zhuangtai: zhuangtai} }); } }, '|', { text: '新增' , iconCls: 'btAdd' , handler: function() { PersonWin.show(); } } ], bbar: new Ext.PagingToolbar({ pageSize: 20, store: store, hasPageBarLoad: true, displayInfo: true, displayMsg: '当前列表:从第{0} - {1}个记录 共有 {2} 个记录', emptyMsg: "当前条件下没有可以显示的记录", beforePageText: "第", afterPageText: "页共 {0} 页", prevText: "上一页", firstText: "第一页", nextText: "下一页", lastText: "最后一页", refreshText: "刷新" }) , listeners: { 'rowclick': { fn: function(grid, rowIndex, e) { } , scopt: this } } }) window.grid = grid grid.store.load({ params: { start: 0, limit: 20} }); comboYN.load() })