jqGrid 学习笔记--数据异步加载方法 随笔1

43 篇文章 0 订阅
21 篇文章 0 订阅
 
var commonQuery = '../importantInfoReport/pageQueryImportantInfoReport.action?type=0';
	jQuery("#listImportInfoReport").jqGrid ({
		rowNum : 10,
		type:'POST',
		pager : '#pagerImportantInfoReport',
		viewrecords : true,
		multiselect: true,
		width: defaultGridWidth,
		height : defaultGridHeight,
	   	url: commonQuery,
		datatype : "json",
	   	jsonReader: { 
	      root:"dataRows", page:"page", total:"total", records:"records", repeatitems:false, id : "id"
	  	},
		colNames : [
			'ID',
			'事件名称',
			'事件等级',
			'进展情况',
			'接收范围',
			'报送人',
			'报送时间',
			'操作'
    	],
		colModel : [
			{name:'id', label:'ID', index:'id',hidden:true}
			, {name:'eventName', label:'事件名称', index:'eventName', width:100}
			, {name:'state', label:'事件等级', index:'state',hidden:true}
			, {name:'progress', label:'进展情况', index:'progress', width:100}
			, {name:'receiver', label:'接收范围', index:'receiver', width:150}
			, {name:'sendor', label:'报送人', index:'sendor',hidden:true}
    		, {name:'createTime', label:'报送时间', index:'createTime',formatter:'date',formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d H:i:s'}, width:70}
    		, {name:'action', index:'action',align:"center", width:60}
		],
		sortname: 'id',
	    sortorder:  'desc',
		gridComplete : function() {
			var ids=jQuery("#listImportInfoReport").jqGrid('getDataIDs');
	    	for(var i=0;i<ids.length;i++)
	    	{
	    		var cl = ids[i];
	    		//alert(cl);
	    		var rowdata=jQuery("#listImportInfoReport").jqGrid('getRowData',cl);
	    		//实例ID
	    		var Id=rowdata["id"];		    	
	    		be = "<input style='height:22px;width:40px;' type='button' value='查看' οnclick='javascript:viewImportantInfoReportById(" + Id +")'/>"; 
	    		del = "<input style='height:22px;width:40px;' type='button' value='删除' οnclick='javascript:delImportantInfoReportById(" + Id +")'/>"; 	
				jQuery("#listImportInfoReport").jqGrid('setRowData',ids[i],{action:be+del});
	    	}
		},
		onSelectRow: function(id){
			
		}
	});
	jQuery("#listImportInfoReport").jqGrid('navGrid', "#pagerImportantInfoReport", {
		edit : false, add : false, del : false, multipleSearch : false, search : false
	});

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值