mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #1987 from matmair/fix-for-1986
Disable table sorting when order is fixed
This commit is contained in:
commit
370fbea396
@ -814,16 +814,18 @@ function loadPartTable(table, url, options={}) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
columns.push({
|
col = {
|
||||||
field: 'IPN',
|
field: 'IPN',
|
||||||
title: 'IPN',
|
title: 'IPN',
|
||||||
sortable: true,
|
};
|
||||||
}),
|
if (!options.params.ordering) {
|
||||||
|
col['sortable'] = true;
|
||||||
|
};
|
||||||
|
columns.push(col);
|
||||||
|
|
||||||
columns.push({
|
col = {
|
||||||
field: 'name',
|
field: 'name',
|
||||||
title: '{% trans "Part" %}',
|
title: '{% trans "Part" %}',
|
||||||
sortable: true,
|
|
||||||
switchable: false,
|
switchable: false,
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
|
|
||||||
@ -851,7 +853,11 @@ function loadPartTable(table, url, options={}) {
|
|||||||
|
|
||||||
return display;
|
return display;
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
if (!options.params.ordering) {
|
||||||
|
col['sortable'] = true;
|
||||||
|
};
|
||||||
|
columns.push(col);
|
||||||
|
|
||||||
columns.push({
|
columns.push({
|
||||||
field: 'description',
|
field: 'description',
|
||||||
@ -866,8 +872,7 @@ function loadPartTable(table, url, options={}) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
columns.push({
|
col = {
|
||||||
sortable: true,
|
|
||||||
sortName: 'category',
|
sortName: 'category',
|
||||||
field: 'category_detail',
|
field: 'category_detail',
|
||||||
title: '{% trans "Category" %}',
|
title: '{% trans "Category" %}',
|
||||||
@ -879,13 +884,16 @@ function loadPartTable(table, url, options={}) {
|
|||||||
return '{% trans "No category" %}';
|
return '{% trans "No category" %}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
if (!options.params.ordering) {
|
||||||
|
col['sortable'] = true;
|
||||||
|
};
|
||||||
|
columns.push(col);
|
||||||
|
|
||||||
columns.push({
|
col = {
|
||||||
field: 'in_stock',
|
field: 'in_stock',
|
||||||
title: '{% trans "Stock" %}',
|
title: '{% trans "Stock" %}',
|
||||||
searchable: false,
|
searchable: false,
|
||||||
sortable: true,
|
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
var link = "stock";
|
var link = "stock";
|
||||||
|
|
||||||
@ -912,7 +920,11 @@ function loadPartTable(table, url, options={}) {
|
|||||||
|
|
||||||
return renderLink(value, '/part/' + row.pk + "/" + link + "/");
|
return renderLink(value, '/part/' + row.pk + "/" + link + "/");
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
if (!options.params.ordering) {
|
||||||
|
col['sortable'] = true;
|
||||||
|
};
|
||||||
|
columns.push(col);
|
||||||
|
|
||||||
columns.push({
|
columns.push({
|
||||||
field: 'link',
|
field: 'link',
|
||||||
|
Loading…
Reference in New Issue
Block a user