Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7667847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:12:31+00:00 2026-05-31T15:12:31+00:00

jqgrid header may contain extra toolbar defined using toolbar: [true, top], contains navigation toolbar

  • 0

jqgrid header

may contain extra toolbar defined using

toolbar: [true, "top"], 

contains navigation toolbar defined using

$grid.jqGrid('navButtonAdd', '#grid_toppager', {...

and contains search toolbar.

To resize grid to end of screen I’m looking for a way to calculate this header height
in window resize.
I tried code below but this sets grid height too big.
How to calculate grid header height ?

$(window).resize(function () { 
  var extraToolbarHeight = $('#t_' + $.jgrid.jqID($grid[0].id)).outerHeight(true),
       caption_height=$("div#gview_"+$grid[0].id+" > div.ui-jqgrid-hdiv").outerHeight(true);
  $('#grid1container').height($(window).height() - 18);
  $grid.jqGrid('setGridHeight', $('#grid1container').height()-caption_height
        -extraToolbarHeight );
     });


    <div id="grid1container" style="width: 100%; height: 100%">
        <table id="grid">
        </table>
    </div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T15:12:32+00:00Added an answer on May 31, 2026 at 3:12 pm

    Here is a function I wrote to resize my jqGrids to fit their container element. See if it fits your needs.

    // resize a grid to fill the space of its container
    // this will throw an error if you pass in a non-existant
    // Parameters:
    //  grid - a reference to your grid
    //  container - a reference to your container, or the selector
    // Usage:
    // resizeGrid($('#gridXYZ'), '#largeGridDiv')
    function resizeGrid(grid, container) {
        if (typeof container == 'string') {
            container = $(container);
        }
        if (container.length > 0) {
            var headerHeight = $($('.ui-jqgrid-hdiv')[0]).height();
            var newHeight = container.height() - headerHeight;
            grid.jqGrid().setGridHeight(newHeight);
            grid.jqGrid().setGridWidth(container.width());
        } else {
            throw ('Non-existant container passed to resizeGrid()');
        }
    }
    
    
    // some other selectors that may help, again grid 
    var gviewSelector = '#gview_' + $('#gridXYZ').attr('id');
    var headerSelector = gviewSelector + ' .ui-jqgrid-hdiv';
    var bodySelector = gviewSelector + ' .ui-jqgrid-bdiv';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

jqGrid Edit form invoked using Edit button from top toolbar is defined as grid.navGrid(#grid_toppager,
jqgrid doc in here contains: method allow to reorder the grid columns using the
When I use $('#mygrid').jqGrid('GridUnload'); my grid is destroyed: no pager/ no header. In a
I am using the new header grouping feature of jqgrid 4.2 which works great
I have tried to figure out how to disable the header for a jqGrid,
I am using jqGrid ( http://www.trirand.com/blog/ ) to display some read-only data. The resizeable
I want to add a header to my JQgrid without pushing a custom div
I am using a jqGrid that has allot of columns to it. I added
I have defined the following button in jqgrid. I have looked up alot of
Is it possible to align grid column headers in jqgrid? eg align left right

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.