2010-06-23 121 views
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> 

回答

1

也許答案Adding button to jqGrid top toolbar會幫助你?如果不試圖更準確地解釋導航欄或其他jqGrid元素的哪些元素,您將移動到另一個地方。

+0

希望複製在底部和格柵頂部如下因素 .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

+0

@Spanner:看看http://stackoverflow.com/questions/3929896/adding-jqgrid-custom-navigation -to-頂部工具欄/ 3932314#3932314。看來解決方案就是你需要的。 – Oleg 2010-10-14 11:07:33

相關問題