Deprecated: iconv_set_encoding(): Use of iconv.internal_encoding is deprecated in /home/datamerx/public_html2/jqgrid/jqgrid/libraries/joomla/string/string.php on line 28

Deprecated: iconv_set_encoding(): Use of iconv.input_encoding is deprecated in /home/datamerx/public_html2/jqgrid/jqgrid/libraries/joomla/string/string.php on line 29

Deprecated: iconv_set_encoding(): Use of iconv.output_encoding is deprecated in /home/datamerx/public_html2/jqgrid/jqgrid/libraries/joomla/string/string.php on line 30

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/datamerx/public_html2/jqgrid/jqgrid/libraries/joomla/filter/input.php on line 652

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/datamerx/public_html2/jqgrid/jqgrid/libraries/joomla/filter/input.php on line 652
jqGrid Forums :: Topic: two columns sorting (1/1)
Welcome, Guest
Username: Password: Remember me

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/datamerx/public_html2/jqgrid/jqgrid/libraries/joomla/filter/input.php on line 652
  • Page:
  • 1

TOPIC: two columns sorting

two columns sorting 3 years 1 month ago #118

  • cnpphani

  • Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/datamerx/public_html2/jqgrid/jqgrid/libraries/joomla/filter/input.php on line 652
  • cnpphani's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
  • Karma: 0
Hi

I have 10 columns in my jqgrid so my question is out of 10 columns two columns are require asennding order sroting depends on due date order id will display asendning order

means primary sorting is due date and secondary sorting is order id.
can you please tell me how to do in jqgrid
The administrator has disabled public write access.

two columns sorting 3 years 1 month ago #119

  • positron

  • Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/datamerx/public_html2/jqgrid/jqgrid/libraries/joomla/filter/input.php on line 652
  • positron's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 59
  • Thank you received: 4
  • Karma: 1
You should have your grid defined as:

$("#yourTableID").jqGrid({
......
multiSort:true
sortname: 'dueDate asc, orderID',
sortorder: 'asc',
...........
colModel: [
{name: 'dueDate ', ......},
{name: 'orderID', ......}
],
............
});

Please, pay attention that the ascending sort on the orderID is actually specified in the sortorder parameter. In general the default sort order of the last column mentioned in the sortname list is specified in the sortorder parameter and not in the list itself.

Now that sorting will work out of the box for local data only. It will just get the sort icons displayed on the columns for datatype xml or json. If you are using any of these two, i.e. server data, you'll have to sort your data on the server before sending it back to jqGrid. Luckily the sidx URL param contains the sort clause so that your server code knows which columns to sort on.
The administrator has disabled public write access.

two columns sorting 3 years 1 month ago #120

  • Cerberus

  • Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/datamerx/public_html2/jqgrid/jqgrid/libraries/joomla/filter/input.php on line 652
  • Cerberus's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 53
  • Thank you received: 3
  • Karma: 0
Here is a demo of multi-column sorting in jqGrid - codemerx.com/jqgrid/demos/jqgrid-standal...multi-column-sorting
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 0.128 seconds