admin管理员组

文章数量:1426056

I want to enable sorting but group multiples row into one in the same time. So that they will always sorted by in groups. Like row of group 1 will stick with group 1 and so on..

I want to enable sorting but group multiples row into one in the same time. So that they will always sorted by in groups. Like row of group 1 will stick with group 1 and so on..

http://live.datatables/wuwaxiqe/1/edit

Share Improve this question edited Mar 15, 2018 at 17:57 Gyrocode. 59k16 gold badges157 silver badges192 bronze badges asked May 15, 2016 at 15:45 Jamie JordanJamie Jordan 2511 gold badge5 silver badges16 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

Use orderFixed option to always apply ordering to a certain column before/after any other columns.

For example:

var table = $('#example').DataTable({
   "orderFixed": {
      "pre": [ 2, 'asc' ]
   }        
});

See updated example for code and demonstration.

本文标签: javascriptDatatable sorting but group rowsStack Overflow