⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 noneprofessorsearchgrid.js

📁 重点不是信息管理系统
💻 JS
字号:
function formatDate(value){
        return value ? value.dateFormat('Y-m-d') : '';
    };
function newNoneProfessorSearchGrid(title,paramValue){
	//Ext.Msg.alert("","newNoneProfessorSearchGrid1");
  var nonenoneProfessorSearchGrid;
	var page=1;
	var tableName="noneprofessor";
	var Record=Ext.data.Record.create(
		     [{name:"name"},{name:"sex"},{name:"id"},{name:"nationality"},{name:"birthday",type:"date",dateFormat:"Y-m-d"},{name:"idcard"},
		     {name:"education"},{name:"theologyeducation"},{name:"authenticationunit"},{name:"recordtime",type:"date",dateFormat:"Y-m-d"},
		     {name:"churchpoint"},{name:"churchduty"},{name:"credentialnumber"}
		     ]
		  );
		  var store = new Ext.data.JsonStore({
			url:"/servlet/search.do?tableName="+tableName,
			baseParams:paramValue,
			totalProperty:"totalProperty",
			root: "row",
			id:"id",
			fields:Record
		  }); 
		  //Ext.Msg.alert("",store); 
	 	    if(!noneProfessorSearchGridCm){
	 	    //Ext.Msg.alert("",store.getAt(0).get("id"));
	 	    noneProfessorSearchGridCm=new Ext.grid.ColumnModel([
		    {header:"序号",dataIndex:"id",width:40},
		    {header:"姓名",dataIndex:"name",width:80,
		    editor:new Ext.form.TextField({		
		  	})},
		    {header:"性别",dataIndex:"sex",width:80,
		    editor:new Ext.form.ComboBox({
		    	typeAhead:true,
		    	triggerAction:"all",
		    	transform:"noneProGrid-sex",
		    	lazyRender:true  	
		    })},
		    {header:"民族",dataIndex:"nationality",width:80,
		    editor:new Ext.form.TextField({		
		  	})
		    },
		    {header:"出生年月",dataIndex:"birthday",width:80,
		    renderer:formatDate,
		    editor:new Ext.form.DateField({
		    	format:"Y-m-d"
		    })},
		    {header:"身份证号",dataIndex:"idcard",width:80,
		    editor:new Ext.form.NumberField({
		    	allowNegative:false
		    })},
		   {header:"文化程度",dataIndex:"education",width:80,
		    editor:new Ext.form.ComboBox({
		    	typeAhead:true,
		    	triggerAction:"all",
		    	transform:"noneProGrid-education",
		    	lazyRender:true  	
		    })},
		    {header:"神学教育",dataIndex:"theologyeducation",width:80,
		    editor:new Ext.form.TextField({		
		  	})},
		    {header:"认定单位",dataIndex:"authenticationunit",width:80,
		    editor:new Ext.form.TextField({		
		  	})},
		    {header:"备案时间",dataIndex:"recordtime",width:80,
		    renderer:formatDate,
		    editor:new Ext.form.DateField({
		    	format:"Y-m-d"
		    })},
		    {header:"所在堂点",dataIndex:"churchpoint",width:80,
		    editor:new Ext.form.ComboBox({
		    	typeAhead:true,
		    	triggerAction:"all",
		    	transform:"noneProGrid-churchpoint",
		    	lazyRender:true  	
		    })}, 
		    {header:"堂点职务",dataIndex:"churchduty",width:80,
		    editor:new Ext.form.ComboBox({
		    	typeAhead:true,
		    	triggerAction:"all",
		    	transform:"noneProGrid-churchduty",
		    	lazyRender:true  	
		    })},
		    {header:"证件编号",dataIndex:"credentialnumber",width:80,
		    editor:new Ext.form.NumberField({
		    	allowNegative:false
		    })},
		    ]);
		    //Ext.Msg.alert("","noneprocm完成");
	 	  }
	 	 function add(){
	 	  addTool(noneProfessorSearchGrid,++noneProfessortableCount);
	 	 }
	 function nextPage(){
	 	page=nextPageTool(noneProfessorSearchGrid,page);//由于这里的page和pagingToolBar的page不同步,所以要么只用鼠标,要么只用键盘,来加载下一页。
	 }
	 function previousPage(){
	 	page=previousPageTool(noneProfessorSearchGrid,page);
	}
	 	function remove(){
	 	  removeTool(noneProfessorSearchGrid,tableName);
	 	}
	 function newForm(){
	  newFormTool(noneProfessorSearchGrid,tableName);
	}
         noneProfessorSearchGrid=new Ext.grid.EditorGridPanel({
		  	id:"noneProfessorSearchGrid"+(++window.noneProfessorSearchCount),
		  	title:title, 
		    store:store,
		    height:document.documentElement.clientHeight,
		    height:500,
		    cm: noneProfessorSearchGridCm,
		    keys:[{
		      key:"q",
		      shift: true,
	          fn: add
		    },{
		      key:"o",
		      shift:true,
		      fn:add
		    },{
		      key:"d",
		      shift:true,
			  fn:remove
		    },{
		      key:Ext.EventObject.DELETE,
		      fn:remove
		    },{
		      key:Ext.EventObject.PAGEDOWN,
		      fn:nextPage
		    },{
		      key:Ext.EventObject.PAGEUP,
		      fn:previousPage
		    }],
		    forceFit:true,
		    //loadMask :true,
		    frame:true,
		    clicksToEdit:1,
		    closable:true,
		    selModel: new Ext.grid.RowSelectionModel({singleSelect:false}),//设置可多行选中模式
		    bbar: new Ext.PagingToolbar({
	            pageSize:24,
	            store: store,
	            displayInfo: true,
	            displayMsg: "共有记录 {2}行 :  {0} 到 {1}",//这里的{0}..不知道在哪里找
	            emptyMsg: "没有信息可以显示"
		    }),
		    tbar: [{
            text: "添加",
            iconCls:"add",
            handler :add
           },{
          text: "删除所选",
		  iconCls:"remove",
          handler : remove
         },{
         text:"打印记录",
         iconCls:"printing",
         handler:newForm
         }]
	});
	 store.load({params:{start:0, limit:24}});
	 noneProfessorSearchGrid.addListener("afteredit",function(grid){
		var f=grid.field;
		var v=grid.value;
		var r=grid.record;
		var paramValue=paramEditValue(r,f,v);
		editRequest("noneprofessor",paramValue);
	})
	store.addListener("add",function(store,records){
		var paramValue={
		    id:records[0].get("id")
		}
		addRequest("noneprofessor",paramValue);
	})
	//Ext.Msg.alert("",noneProfessorSearchGrid.getStore().getAt(0).get("othernumber"))
	noneProfessorSearchGrid.addListener("load",function(){
	  page++;
	})
    return noneProfessorSearchGrid;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -