ashl1 / datatables-rowsgroup

The Datatables feature plugin that groups rows (merge cells vertically) in according to specified columns.
Other
95 stars 94 forks source link

Plugin forces the column order to ASC in order to build the groups? #38

Open denselGit opened 2 years ago

denselGit commented 2 years ago

Hi, I am using Datatables 1.10.21 and Datatables RowsGroup v1.0.0 with Server-side rendering.

Columns 0 and 1 are set for rows grouping option inside table object as:

"rowsGroup": [ 0, 1 ],

If I select Column 0 order I get the correct values for 'order' and 'orderDir' on the server-side. When I Select the Column 1 sort option, the server-side code collects the correct 'order' value (i.e. "1"), but 'order' is always equal to "ASC".

However, I realized that double-click on the column sort option (when "ASC" is active) send order="DESC" on the server-side.

Is there any posibility to make column sorting work as in original datatables without RowsGroup plugin? Thank's in advanced.

dataworking commented 1 year ago

If you comment out this line from the source .js the sorting problem will go away (maybe I will find time to see what this ordering code is trying to do...):

i.e.,

this.table.order($.extend(true, [], this.order));

to

//this.table.order($.extend(true, [], this.order));