fix: column ordering (#47)
This commit is contained in:
parent
a6001ee47a
commit
6cb84817ac
1 changed files with 2 additions and 1 deletions
|
|
@ -71,7 +71,8 @@ export class DataTablesSsp {
|
||||||
this.length = Math.min(100, Math.max(0, parseInt(query.length as string, 10)));
|
this.length = Math.min(100, Math.max(0, parseInt(query.length as string, 10)));
|
||||||
this.draw = parseInt(query.draw as string, 10);
|
this.draw = parseInt(query.draw as string, 10);
|
||||||
this._order = (query.order as { column: string; dir: string }[]).map((order) => {
|
this._order = (query.order as { column: string; dir: string }[]).map((order) => {
|
||||||
return { column: parseInt(order.column, 10), dir: order.dir };
|
const dir = order.dir.toUpperCase() === "DESC" ? "DESC" : "ASC";
|
||||||
|
return { column: parseInt(order.column, 10), dir };
|
||||||
});
|
});
|
||||||
this.columns = (
|
this.columns = (
|
||||||
query.columns as { data: string; name: string; searchable: string; orderable: string; search: { value: string; regex: string } }[]
|
query.columns as { data: string; name: string; searchable: string; orderable: string; search: { value: string; regex: string } }[]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue