mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 18:58:46 +02:00
Fixed ordering columns of tables when columns were reordered
This commit is contained in:
parent
f8e299ec56
commit
b6dd5bb881
2 changed files with 11 additions and 2 deletions
|
@ -68,8 +68,6 @@ export default class extends Controller {
|
||||||
stateLoadCallback(settings) {
|
stateLoadCallback(settings) {
|
||||||
const data = JSON.parse( localStorage.getItem(this.getStateSaveKey()) );
|
const data = JSON.parse( localStorage.getItem(this.getStateSaveKey()) );
|
||||||
|
|
||||||
debugger;
|
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
//Do not save the start value (current page), as we want to always start at the first page on a page reload
|
//Do not save the start value (current page), as we want to always start at the first page on a page reload
|
||||||
delete data.start;
|
delete data.start;
|
||||||
|
|
|
@ -72,6 +72,17 @@
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
request._dt = config.name;
|
request._dt = config.name;
|
||||||
|
|
||||||
|
//Try to resolve the original column index when the column was reordered (using the ColReorder plugin)
|
||||||
|
//Only do this when _ColReorder_iOrigCol is available
|
||||||
|
if (settings.aoColumns && settings.aoColumns.length && settings.aoColumns[0]._ColReorder_iOrigCol !== undefined) {
|
||||||
|
if (request.order && request.order.length) {
|
||||||
|
request.order.forEach(function (order) {
|
||||||
|
order.column = settings.aoColumns[order.column]._ColReorder_iOrigCol;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$.ajax(typeof config.url === 'function' ? config.url(dt) : config.url, {
|
$.ajax(typeof config.url === 'function' ? config.url(dt) : config.url, {
|
||||||
method: config.method,
|
method: config.method,
|
||||||
data: request
|
data: request
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue