1

I am using Jqgrid in my project and wants to add 'All' along with page size in footer dropdownlist.So please let me know how can I show it.Also when user select All from dropdownlist it will display all the record.Please refer attached file.

enter image description here

Pankaj
  • 3,131
  • 4
  • 14
  • 22

1 Answers1

2

Dropdown exist if you use rowList option. Mostly one uses array of numbers as the value of rowList like

rowNum: 10,
rowList: [5, 10, 20, 10000]

jqGrid generates dropdown like

<select class="ui-widget-content ui-pg-selbox" title="Records per Page">
    <option value="5">5</option>
    <option value="10" selected="selected">10</option>
    <option value="20">20</option>
    <option value="10000">10000</option>
</select>

where the options have the same value and the text.

On the other side one can specify both text and values. One need just use :-separated string. For example

rowNum: 10,
rowList: [5, 10, 20, "10000:All"]

generates

<select class="ui-widget-content ui-pg-selbox" title="Records per Page">
    <option value="5">5</option>
    <option value="10" selected="selected">10</option>
    <option value="20">20</option>
    <option value="10000">All</option>
</select>

which looks like

enter image description here

One can't require to display really all rows, but one can use large enough value like 10000 and show some text like "All" instead of 10000.

Oleg
  • 220,925
  • 34
  • 403
  • 798