0

the following link generates a pivot jqgrid that will load some sales information about cars enter link description here

it has about 11 car sales objects. it has a custom sort order that i have given and the purpose of the custom sort order to display data in custom order when data loads to the grid and it works but the issue is when user clicks the column name 'model' it should be sorting car names by name in the alphabetical order but instead its sorts using my custom order. But it should not use custom order to sort columns when user clicks on the header, it should use its default sort order sorting by alphabetical order.

How do i still keep the custom order that i have given and at the same time let the columns gets sorted in the alphabetical order if user clicks a column?

secondly, Different browser shows different ways. when i load the grid with a large dataset it behaves differently in two of the following operations

In chrome: 1. When user selects 'All' (show all records) from the navbar at the bottom the custom order that i have given as the sort order for grid load breaks and some gets positioned in different places

but in IE browser, this won't happen

  1. In both IE and chrome, after loading data when user clicks the column name Model column data gets sorted using custom sort order and not by alphabetical order.

How do i fix these issues

4

1 回答 1

1

如果要按字母顺序对列进行排序,则应sorttype从第二 ( ) 列中删除。modelhttps://jsfiddle.net/OlegKi/dk7uth40/3/

顺便说一下free jqGrid支持选项

threeStateSort: true

它实现了三态排序。您可以在演示https://jsfiddle.net/OlegKi/dk7uth40/4/上查看结果。用户最初以原始顺序查看数据。通过首先单击该model列,数据将按字母顺序(升序)排序。通过第二次单击,数据将按字母降序排序。第三次单击列标题将返回初始排序顺序中的顺序。

于 2017-01-07T15:46:39.580 回答