Closed valeriy-efimov closed 1 year ago
I'm actually surprised this doesn't work correctly, as I would expect the plugin to handle this completely inside DataTables itself.
Do you have concrete information on what is broken and how?
Hi @curry684 this trick resolved bug but I think it's a crutch.
this.datatable.on('preXhr', function(e, settings, details) {
let columns = Object.values(
Object.assign({}, settings.aoColumns));
columns = columns.sort(function(a, b) {
return a.index - b.index;
});
let original = [];
columns.forEach((element) => {
original.push(
details.columns.find(x => x.data === element.data));
});
details.order.forEach((element) => {
let orig = settings.aoColumns.find(
x => x.idx === element.column);
element.column = orig.index;
});
details.columns = original;
});
Yeah that does seem a crutch, but looking at that - can we even be aware on the server end of what we would need to do?
I'm flagging it as an enhancement because I do not consider optional plugins something we must properly support.
Stale issue message
I'm try to use this https://datatables.net/extensions/colreorder/examples/integration/server_side.html But on server side got wrong column order and individual search. If I swap first and second column and try to order first datatables-bundle sorted by default first.