jquery ligerui中的grid组件

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<script src="<%=basePath%>resources/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
</head>
<script type="text/javascript">
 $(function ()
        {
           window['g'] = maingrid=
            $("#maingrid").ligerGrid({
				width:'100%',              
				headerRowHeight:35, 
                columns: [
				{ 
                  display: /*'<input type="checkbox" style="margin-left:10px;margin-top:5px;" onclick="selectAll();" id="all"/>' +*/ '<span style="margin-left:14px;">管理状态</span>', 
				  name: 'managed', align: 'left', width: '10%' ,
				  render: function(item,row){
				  	if(item.managed == 1){
				  		var html = '<input type="checkbox" name="cbo" id="checkbox" value="' +item.managed+ '" style="padding:0px;margin:0px;margin-top:5px;margin-left:15px;" onclick="itemclick(this);" checked /> ';
				  		return html;
				  	}else if(item.managed ==0){
				  		var html = '<input type="checkbox" name="cbo" id="checkbox" value="' +item.managed+ '" style="padding:0px;margin:0px;margin-top:5px;margin-left:15px;" onclick="itemclick(this);"/>';
				  		return html;
				  	}
				  }							
				},
				{ display: 'id',
				  name: 'id' ,width:'0'	,hide:'true' },
                { display: '设备名', 
				  name: 'name', align: 'left', width: '10%'},				  			
                { display: '设备IP', 
				  name: 'loopbackIp', align: 'left',width:'15%' },
                { display: '设备类型', 
				  name: 'resourceName', align: 'left',width:'15%' },
                { display: '厂商', 
				  name: 'vendorName',align: 'left',width: '15%'},
				{ display: '型号', 
				  name: 'deviceModel',align: 'left',width:'15%' },
				{ display: '上联设备', 
				name: 'parentId',align: 'left',width:'10%' },
				{ display: '是否自定义', 
				  name: 'selfdefine',align: 'left',width:'10%',
				  render: function(item){
				  	if(item.selfdefine == "0"){
				  		return "√";
				  	}else{
				  		return " ";
				  	}
				  }
                }], 
                root :'rows',                       //数据源字段名
        	record:'total',
		url: 'topodevice/queryAllTopoDevice', 
                pageSize:10 ,
                rownumbers:false,
                pageParmName:'page'
            });              
            $("#pageloading").hide();
        }); 
</script>

<body>
	<div id="maingrid" style="margin-top:0px">
</body>
</html>




你可能感兴趣的:(jquery ligerui中的grid组件)