开发者

jqGrid Top Toolbar

I am trying to replicate the action buttons that are present in the bottom toolbar on the top toolbar.

But so far no luck, I have included the truncated code below.

Paging is not an option in this case so the user requires both top and bottom toolbars.

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" })

where

<table id="GridName" class="scroll"></table>开发者_运维知识库
<div id="GridnamePager" class="scroll" style="text-align:center;"></div>


Probably the answer Adding button to jqGrid top toolbar would helps you? If not try to explain more exactly which elements of navigation bar or other jqGrid elements you would be move to another place.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜