mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Optionally select which column gets grouped
- Allow grouping by numerical values
This commit is contained in:
parent
e4acca2951
commit
7ac52d4d9f
@ -46,6 +46,7 @@
|
||||
location_detail: true,
|
||||
part_detail: true,
|
||||
},
|
||||
groupByField: 'location',
|
||||
buttons: [
|
||||
'#stock-options',
|
||||
],
|
||||
|
@ -72,9 +72,9 @@
|
||||
|
||||
if (this.options.groupBy && this.options.groupByField !== '') {
|
||||
|
||||
if (1 || (this.options.sortName != this.options.groupByField)) {
|
||||
if (this.options.sortName != this.options.groupByField) {
|
||||
this.data.sort(function (a, b) {
|
||||
return a[that.options.groupByField].localeCompare(b[that.options.groupByField]);
|
||||
return a[that.options.groupByField] == b[that.options.groupByField];
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -385,8 +385,7 @@ function loadStockTable(table, options) {
|
||||
pageSize: 25,
|
||||
rememberOrder: true,
|
||||
groupBy: true,
|
||||
groupByField: 'part_name',
|
||||
groupByFields: ['part_name', 'test'],
|
||||
groupByField: options.groupByField || 'part',
|
||||
groupByFormatter: function(field, id, data) {
|
||||
|
||||
if (field == 'Part') {
|
||||
@ -404,7 +403,7 @@ function loadStockTable(table, options) {
|
||||
stock += item.quantity;
|
||||
});
|
||||
|
||||
return stock + ' <i>(' + data.length + ' items)</i>';
|
||||
return stock;
|
||||
} else if (field == 'Location') {
|
||||
/* Determine how many locations */
|
||||
var locations = [];
|
||||
|
Loading…
Reference in New Issue
Block a user