我有一个带有一堆列的道场网格。默认情况下,当您单击列标题时,它会按升序对列进行排序(也很糟糕,优先考虑大写字母,而不是在排序函数中对字符串进行 lcas)。我想要的是当您仅单击特定列的标题时,默认顺序为降序。例如:
Col A - 升序
B 口 - 下降
C 口 - 升序
Col D - 降序
不要建议 grid.setSortIndex(0) 因为它只指定整个网格上的默认排序 - 这不是我想要的。 Dojo 文档太糟糕了!
提前非常感谢...
I have a dojo grid with a bunch of columns. By default when you click on the column heading, it sorts the column in ascending order (pretty poorly too, giving precedence to capital letters instead of lcas'ing the string in the sort function). What I want is to have the default order be descending when you click the header only for particular columns. For example:
Col A - ascending
Col B - descending
Col C - ascending
Col D - descending
Don't suggest grid.setSortIndex(0) because that only specifies the default sort on the entire grid - that's not what i'm looking for. Dojo documentation is horrible!
Many many thanks in advance...
发布评论
评论(1)
根据 Dojo 文档,setSortIndex 可以接收两个参数 - 第一个用于列索引,第二个为方向。
注意:编辑为具有该方法的 API 的直接链接
According to the Dojo docs, setSortIndex can receive two parameters - the first for the column index and the second for the direction.
Note: Edited to have the direct link to the API for that method