John
John

Reputation: 1522

Jquery/JqGrid - Grid paging controls are cut off when a grid contains only a single column

I have a page which contains a dynamically generated grid, where a user can select which columns are shown. There can be a reasonable amount of data rows, so the grid has paging enabled.

The works fine in most circumstances, except when there is only a single column displayed. In this case, the paging control is cut off at about the halfway mark, making it impossible to page.

I've created two simple grids in JSFiddle to illustrate - http://jsfiddle.net/2wj2A/ . The top grid with two cols looks as expected, whereas the bottom grid with a single column shows the cut off problem.

Is there any way to make the grid take the paging control into account when it shrinks to fit?

Upvotes: 1

Views: 811

Answers (1)

Justin Ethier
Justin Ethier

Reputation: 134177

It is not clear to me exactly how your application is rendering the grid. That said, if you can detect when only one column is displayed, you could add code to ensure that the grid (and that single column) is at least a certain minimum width. Then you just need to make the minimum value wide enough that the pager controls are not truncated.

Does that help?

Upvotes: 1

Related Questions