2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

Buttons to toggle between list and grid views

This commit is contained in:
Oliver Walters
2021-05-30 00:23:05 +10:00
parent ee95cf5c21
commit e846c744f4
2 changed files with 27 additions and 4 deletions

View File

@ -347,7 +347,6 @@ function loadPartTable(table, url, options={}) {
* query: extra query params for API request
* buttons: If provided, link buttons to selection status of this table
* disableFilters: If true, disable custom filters
* gridView: If true, display as grid rather than standard table
*/
// Ensure category detail is included
@ -511,8 +510,8 @@ function loadPartTable(table, url, options={}) {
formatNoMatches: function() { return '{% trans "No parts found" %}'; },
columns: columns,
showColumns: true,
showCustomView: true,
showCustomViewButton: true,
showCustomView: false,
showCustomViewButton: false,
customView: function(data) {
var html = '';
@ -524,7 +523,7 @@ function loadPartTable(table, url, options={}) {
return `<div class='row mx-0'>${html}</div>`;
}
});
if (options.buttons) {
linkButtonsToSelection($(table), options.buttons);
}