2
我想复制出现在顶部工具栏底部工具栏中的动作按钮。jqGrid顶部工具栏
但到目前为止没有运气,我已经在下面包括了截断的代码。
在这种情况下,分页不是一个选项,所以用户需要顶部和底部的工具栏。
jQuery("#GridName").jqGrid({
url: '<%= ResolveUrl("~") %>SomeController/SomeMethod ....',
datatype: 'json',
colNames: ['Column1', 'Column2', 'Details', 'Date'],
colModel: [
//......
],
pager: '#GridNamePager',
viewrecords: true,
emptyrecords: "Nothing to display",
shrinkToFit: true,
hidegrid: false,
scroll: false,
width: 976,
height: 'auto',
loadui: 'enable',
pgtext: '',
pgbuttons: false,
pginput: false,
multiselect: true,
multiboxonly: true,
toolbar:[true,"top"],
ondblClickRow: function(id) {
var publishedUrl =
$("#GridName").find("tbody")[0].rows[id-1].cells[5].innerHTML;
},
caption: "Grid Results"
}).navGrid('#GridNamePager', { add: false, edit: false, del: false,
search: false, cloneToTop:true })
.navButtonAdd('#GridNamePager', { caption: "Save", onClickButton:
function() { Save(); return false; }, position: "last" })
.navButtonAdd('#GridNamePager', { caption: "Back", onClickButton:
function() { redirectBack(); return false; }, position: "last" })
其中
<table id="GridName" class="scroll"></table>
<div id="GridnamePager" class="scroll" style="text-align:center;"></div>
希望复制在底部和格栅顶部如下因素 .navGrid( '#GridNamePager',{补充:假的,编辑:假的,德尔:假的, 搜索:假的,cloneToTop:真}) .navButtonAdd ('#GridNamePager',{caption:“Save”,onClickButton: function(){Save(); return false;},position:“last”}) .navButtonAdd('#GridNamePager',{caption:“Back “,onClickButton: function(){redirectBack(); return false;},position:”last“}) – Spanner 2010-07-07 11:40:21
@Spanner:看看http://stackoverflow.com/questions/3929896/adding-jqgrid-custom-navigation -to-顶部工具栏/ 3932314#3932314。看来解决方案就是你需要的。 – Oleg 2010-10-14 11:07:33