2

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>
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Spanner
  • 31
  • 2
  • 5

1 Answers1

1

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.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
  • Want to replicate the folowing at bottom and top of grid .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" }) – Spanner Jul 07 '10 at 11:40
  • @Spanner: look at http://stackoverflow.com/questions/3929896/adding-jqgrid-custom-navigation-to-top-toolbar/3932314#3932314. It seems that the solution is what you need. – Oleg Oct 14 '10 at 11:07