我使用 jqGrid Plugin for jQuery 创建了一个表格,并依靠以下演示,我想拖放表格的行。演示:http ://trirand.com/blog/jqgrid/jqgrid.html (3.3 版新增 -> 行拖放)
当我尝试拖动一行时,我在 firebug 中收到错误“TypeError: e is null”。我搜索了这个问题的解决方案,但在这种情况下我没有找到任何东西......此外,我尝试使用与上面示例中所示相同版本的 jQuery 和 jQueryUI,但它不能解决问题。jQuery TableDnD 的新版本(0.7 版)也没有帮助。有解决这个问题的想法吗?
我的代码:
<script type="text/javascript" src="js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="js/jqueryUI-1.10.3.js"></script>
<script type="text/javascript" src="js/jquery.ui.datepicker-de.js"></script>
<script type="text/javascript" src="js/jqGrid/i18n/grid.locale-de.js"></script>
<script type="text/javascript" src="js/jqGrid/jqGrid-4.5.2.js"></script>
<script type="text/javascript" src="js/plugins/jqTableDnD-0.5.js"></script>
<link type="text/css" rel="stylesheet" href="css/cupertino/jquery-ui-1.10.3.css"/>
<link type="text/css" rel="stylesheet" href="css/ui.jqgrid.css" />
<link type="text/css" rel="stylesheet" href="css/ui.multiselect.css" />
<table id="grid"></table>
<div id="navi"></div>
<script type="text/javascript">
$(document).ready(function() {
$("#grid").tableDnD({scrollAmount:0});
$("#grid").jqGrid({
colNames:["Artnr", "Bezeichnung", "Angebot (Position)", "Enddatum Startseite", "Eigener Bestand", "Versandlager Bestand"],
colModel:[
{name:"artnr", index:"artnr", align:"center", width:75, sortable:false, formatter:formatPic},
{name:"benennung", index:"benennung", width:400, sortable:false, formatter:formatLink }
...
],
datatype: "json",
editurl: "edit.php",
height: "auto",
mtype: "POST",
pager: "#navi",
rowNum: 20,
sortname: "angebot",
sortorder: "asc",
url: "load.php",
viewrecords: true,
gridComplete: function() {
$("#_empty","#grid").addClass("nodrag nodrop");
$("#grid").tableDnDUpdate();
}
}).navGrid ('#navi', {view:false,edit:false,add:false,del:true,search:false}, {}, {}, {}, {}, {} )
});
function formatPic(cellVal, options, rowObject) {
return "<htmltag title=\""+ cellVal +"\" class=\"tooltip\">"+ cellVal +"</htmltag>";
}
function formatLink(cellVal, options, rowObject) {
return "<a href=\"../details.php?art=" + rowObject[0] + "\" target=\"_blank\">"+ cellVal +"</a>";
}
</script>
提前致谢!