0

Is it possible to display / generate paging details before the grid? I tried like

<div id="pager1"  style="text-align:center;"></div>
<table id="list1" ></table>

but pagination details are not getting displayed. How to achieve paging details before the grid. Pls help.

user669789
  • 554
  • 4
  • 10
  • 23

1 Answers1

0

Probably you mean the toppager. In the case you will find the answer on your question here. By the way in case of usage the toppager:true you don't need define the div like <div id="pager"></div>, jqGrid will create the corresponding div for you.

On the page of jqGrid documentation I inserted recently two additional screen-shorts which shows different layers which can be managed by jqGrid. On one picture you will find the toppager layer.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
  • thanks oleg, now i am getting page details before the grid. how to implement navigation like next page, last page, previous page is it possible in jqgrid? pls help trirand/blogspot/blogger is blocked in our office, only source to learn jqgrid is stackflow. – user669789 Mar 24 '11 at 06:23
  • @user669789: There are many way to do this. To answer on your question I should know which `datatype` ('json', 'xml', 'local') you use and which kind of grid you use (grid, grid tree, grid with subgrids). In general local jqGrid (any `datatype` excepting 'json' and 'xml') support local data sorting, paging and filtering (searching). In case of remote datatypes ('json' and 'xml') jqGrid send additional parameters in every request to the server and the server must respond the page of data sorted and filtered corresponds to the input parameters. – Oleg Mar 24 '11 at 06:41
  • I am using local datatype, data is coming from array. I could able to get the pagination details after properly mapping css files. my current issue is, I have around 100 rows, when it loads first time all 100 rows are getting displayed (with scroll bar) when i click on header (sorting is enabled) it sorts and displays only 10 rows (rowNum=10). Where i do mistake? – user669789 Mar 24 '11 at 13:05
  • @user669789: You don't post the code of jqGrid which you use and which has the problem. So I uploaded for you here: http://www.ok-soft-gmbh.com/jqGrid/SimpleLocalGrid.htm an example of the local jqGrid which work without any problem. It helps you? – Oleg Mar 24 '11 at 13:38
  • thanks, yes it is helpful. I was using standard code taken from internet. But I created array and written code to add it to jqgrid with a for loop.I understood how to use different themes. I am trying to use altclass and altRow, it is applying the color but it is getting overridden by custom theme. As i not able to paste my entire code. I am giving alt row related code. altRows: true, altclass:'rowstyle', – user669789 Mar 24 '11 at 18:28
  • @user669789: Look at [here](http://stackoverflow.com/questions/4369899/jqgrid-zebra-alt-rows-background-not-working-due-to-ui-theme-class/4382122#4382122). This answer include [the demo](http://www.ok-soft-gmbh.com/jqGrid/altclassTests.htm). – Oleg Mar 24 '11 at 19:45
  • thanks its working, i was trying with backgroud-color css property, instead we should use backgroud. – user669789 Mar 25 '11 at 04:44
  • @user669789: You can use `backgroud-color`, but you should add `background-image: none;` to remove the default background image additionally. – Oleg Mar 25 '11 at 06:50
  • thanks. How to set background image for header? I was trying by defining new css class .ui-jqgrid-sortable {background:url('images/table_header_bg_strip.jpg') repeat-x;image}. But the image is not applied to entire header. For each header column it is applied and I can still see old background color there. Is it because I am applying to wrong component? – user669789 Mar 25 '11 at 13:19
  • @user669789: It would be more easier it you modify the text of [your question](http://stackoverflow.com/questions/5431524/jqgrid-header-background) and append the JavaScript, CSS and HTML code which you try to use and which not work. I will try to modify this to fix the problem. If you just post URL to the page it would be even better. – Oleg Mar 25 '11 at 13:37