【发布时间】:2015-05-25 11:56:43
【问题描述】:
所有, 过去几年我一直在积极使用 jqGrid,现在我需要它来处理需求。看起来名称已更改为 Gurrido JQGrid,并且似乎是许可版本。
如果我不再可以将 jqgrid 用于商业目的,请告诉我吗? 至少我可以使用以前版本的 jqGrid 吗?请告诉我..
谢谢!
更新:粘贴代码 sn-p
<script type="text/javascript">
$(document).ready(function(){
$("#submitbutton1").click(function(){
jQuery("#listTable").jqGrid({
url:'/WebTest/MainAction.do',
datatype: "json",
colNames: ['Label','Value'],
colModel: [
{name:'label',index:'label'},
{name:'value',index:'value'}
],
autowidth : true,
//iconSet: "fontAwesome",
//showOneSortIcon: true,
//autoResizing: { compact: true, widthOfVisiblePartOfSortIcon: 13 },
//autoresizeOnLoad: true,
rowNum: 10,
rowList: [5, 10, 20, "10000:All"],
viewrecords: true,
pager: true,
toppager: true,
rownumbers: true,
sortname: "label",
sortorder: "desc",
caption: "Test"
}).jqGrid("navGrid", { view: true, cloneToTop: true})
.jqGrid("inlineNav")
.jqGrid("filterToolbar")
.jqGrid("gridResize");
})
})
</script>
<html >
<head>
<!-- <link rel="stylesheet" type="text/css" media="screen" href="../font-awesome/css/font-awesome.min.css"> -->
<link rel="stylesheet" type="text/css" media="screen" href="../themes/ui-lightness/jquery-ui-1.10.4.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="../css/ui.jqgrid.min.css" />
<!-- <link rel="stylesheet" type="text/css" media="screen" href="../css/searchFilter.css" /> -->
<!-- <link rel="stylesheet" type="text/css" media="screen" href="../css/ui.multiselect.css" /> -->
<script src="../js/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="../js/jquery-ui-1.10.4.custom.min.js" type="text/javascript"></script>
<script src="../js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script type="text/javascript">
$.jgrid.no_legacy_api = true;
$.jgrid.useJSON = true;
</script>
<script src="../js/jquery.jqgrid.min.js" type="text/javascript"></script> <!-- Version took from free jqgrid github -->
</head>
<title>Test</title>
<body bgcolor="white">
<br>
Hi this is the Test file
<input type="button" name="submitbutton1" id="submitbutton1" value="Test">
<br/>
<div id="outerDiv" style="margin:5px;">
<table id="list"></table>
<!--<div id="pager"></div>-->
</div>
// Tried this also, but its the same. Please note I have removed the iconSet as well.
<table id="listTable"></table>
<div id="pager"></div>
</body>
</html>
【问题讨论】:
-
图片看起来你使用了错误的 CSS,或者你有一些来自网格外部 div 的额外 CSS 规则,这些规则将应用于网格并且你有一些问题。
-
在
<html>之前有<!DOCTYPE html>吗?你在错误的地方使用<title>Test</title>。强烈建议在<head>的开头包含<meta charset="utf-8">和<meta http-equiv="X-UA-Compatible" content="IE=edge">。您将<script>与代码放在哪里?你以前用过哪个版本的jqGrid?我建议在validator.w3.org 中验证您的 HTML 代码。