日期:2014-05-16 浏览次数:21661 次
Ext.onReady( function() { var sm = new Ext.grid.CheckboxSelectionModel(); /** * 生成列模型 */ var cm = new Ext.grid.ColumnModel( [ //new Ext.grid.RowNumberer(), sm, { header :'编号', dataIndex :'id', sortable :true }, { header :'任务状态', dataIndex :'flag', renderer : fullFlag, sortable :true }, { id:'PROJECT_NO', header :'任务编号', dataIndex :'task_no', sortable :true }, { header :'任务执行人', dataIndex :'task_person', sortable :true }, { header :'创建时间', dataIndex :'create_date', sortable :true } , { id:'PROJECT_NO', header :'任务明细', dataIndex :'caozuo', align:'center', renderer:renderProject, sortable: false }]); var tbar =new Ext.Toolbar({ items: [{ text: '新增', id: 'btnAdd' , icon: "./Images/icons/add.png", cls: "x-btn-text-icon", handler : function() { Taskwork.show(); } }, '-', { text: '删除', id: 'btnUpdate', icon: "./Images/icons/delete.png", cls: "x-btn-text-icon", handler : function() { del(); } }, '-', { text: '提交', id: 'btnSubmit' , icon: "./Images/icons/submit.gif", cls: "x-btn-text-icon" } ], listeners : { 'render': function(){ toolBar2.render(grid.tbar); } } }); var store = new Ext.data.JsonStore({ proxy :new Ext.data.HttpProxy( { //method :'get',get模式下提交不了页面的参数 method:'post', url :'WorkTaskList.aspx' }), root :'root', totalProperty :'totalProperty', idProperty: 'threadid', remoteSort: true, fields: [ {name:"id" , type:"int"}, {name:"flag" , type:"int"}, {name:"task_no" , type:"string"} , {name:"task_person" , type:"string"} , {name:"create_date" , type:"string"}, {name:"caozuo" , type:"string"} ] }); /** * 生成Bbar,用于分页显示 */ var bbar = new Ext.PagingToolbar( { pageSize :10, store :store, displayInfo :true, displayMsg :'显示第{0}条到{1}条记录,一共{2}条', emptyMsg :'没有记录' }); /** * 声明一个Grid,列表显示信息 */ var grid = new Ext.grid.GridPanel( { title :'工作任务单', height :600,