mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Improve sorting of part column for BOM table (#5386)
This commit is contained in:
parent
647c3ade20
commit
c39ae80a13
@ -905,6 +905,18 @@ function loadBomTable(table, options={}) {
|
|||||||
title: '{% trans "Part" %}',
|
title: '{% trans "Part" %}',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
switchable: false,
|
switchable: false,
|
||||||
|
sorter: function(_valA, _valB, rowA, rowB) {
|
||||||
|
let name_a = rowA.sub_part_detail.full_name;
|
||||||
|
let name_b = rowB.sub_part_detail.full_name;
|
||||||
|
|
||||||
|
if (name_a > name_b) {
|
||||||
|
return 1;
|
||||||
|
} else if (name_a < name_b) {
|
||||||
|
return -1;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
},
|
||||||
formatter: function(value, row) {
|
formatter: function(value, row) {
|
||||||
var url = `/part/${row.sub_part}/`;
|
var url = `/part/${row.sub_part}/`;
|
||||||
var html = '';
|
var html = '';
|
||||||
|
Loading…
Reference in New Issue
Block a user