You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would take advantage of core process, especially Inventry table filtering.
I've got a bootstrap table setted up in the plugin, by a call to $('#myTable').inventreeTable(options);
I'm able to print the contextualized info, and I would add some fancy features.
To add a list of available filters I've overriden getAvailableTableFilters from core Inventree,
here is the override :
var origgetAvailableTableFilterst = getAvailableTableFilters;
getAvailableTableFilters = function(tableKey) {
if(tableKey == 'SMP_track'){
return {
username: {
title: '{% trans "User Name" %}',
description: '{% trans "Filter by user name" %}',
},
actiontype: {
title: '{% trans "Action Type" %}',
description: '{% trans "Filter by action" %}',
},
test: {
title: '{% trans "Test" %}',
type: 'bool',
}
};
}
return origgetAvailableTableFilterst(tableKey);
}
Seems working, but I feel quite uncomfortable to override a core function.
Is there any process to add available filters for a specific table ?
As far as I've seen, there is no option in .inventreeTablethat could encapsulate this filters (and there is multi call to this function through filter.js btw).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi there again,
I would take advantage of core process, especially Inventry table filtering.
I've got a bootstrap table setted up in the plugin, by a call to
$('#myTable').inventreeTable(options);
I'm able to print the contextualized info, and I would add some fancy features.
To add a list of available filters I've overriden
getAvailableTableFilters
from core Inventree,here is the override :
Seems working, but I feel quite uncomfortable to override a core function.
Is there any process to add available filters for a specific table ?
As far as I've seen, there is no option in
.inventreeTable
that could encapsulate this filters (and there is multi call to this function through filter.js btw).Beta Was this translation helpful? Give feedback.
All reactions