partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 49521214a1fd175b0d8582913959ac080f273059
parent 380d11814b002b6ecdb470dc3641855c1974843d
Author: Felicitus <felicitus@felicitus.org>
Date:   Thu, 26 Nov 2015 20:50:46 +0100

Added filter for internalPartNumber, relates to #501

Diffstat:
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartFilterPanel.js | 18+++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartFilterPanel.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartFilterPanel.js @@ -50,6 +50,7 @@ Ext.define('PartKeepr.PartFilterPanel', { footprintFilter: null, statusFilter: null, conditionFilter: null, + internalPartNumberFilter: null, /** * Initializes the component @@ -92,7 +93,8 @@ Ext.define('PartKeepr.PartFilterPanel', { this.manufacturerFilter, this.footprintFilter, this.statusFilter, - this.conditionFilter + this.conditionFilter, + this.internalPartNumberFilter ] }; @@ -178,6 +180,7 @@ Ext.define('PartKeepr.PartFilterPanel', { this.statusFilter.setValue(""); this.conditionFilter.setValue(""); + this.internalPartNumberFilter.setValue(""); this.onApply(); }, @@ -424,6 +427,11 @@ Ext.define('PartKeepr.PartFilterPanel', { anchor: '100%' }); + this.internalPartNumberFilter = Ext.create("Ext.form.field.Text", { + fieldLabel: i18n("Internal Part Number"), + anchor: '100%' + }); + }, /** * Applies the filter parameters to the passed extraParams object. @@ -565,6 +573,14 @@ Ext.define('PartKeepr.PartFilterPanel', { value: "%" + this.conditionFilter.getValue() + "%" })); } + + if (this.internalPartNumberFilter.getValue() !== "") { + filters.push(Ext.create("Ext.util.Filter", { + property: 'internalPartNumber', + operator: "LIKE", + value: "%" + this.internalPartNumberFilter.getValue() + "%" + })); + } return filters; } });