mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Allow model class to be filtered
- Each subclass should provide a custom filtering function
This commit is contained in:
parent
ee7ab5308e
commit
728597fcdc
4 changed files with 50 additions and 2 deletions
|
|
@ -44,6 +44,15 @@ class InvenTreeStockLocation extends InvenTreeModel {
|
|||
var loc = InvenTreeStockLocation.fromJson(json);
|
||||
|
||||
return loc;
|
||||
}
|
||||
|
||||
@override
|
||||
bool matchAgainstString(String filter) {
|
||||
|
||||
if (name.toLowerCase().contains(filter)) return true;
|
||||
|
||||
if (description.toLowerCase().contains(filter)) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue