partkeepr

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

commit 0aea0caac7318f4bc4adc75dc6ac88f8897eadb2
parent 9d7341bce294e1ce0c11dc79dcaba4a46dc1caf0
Author: Timo A. Hummel <felicitus@felicitus.org>
Date:   Sun, 17 Apr 2016 18:14:30 +0200

Merge pull request #643 from partkeepr/PartKeepr-640

Added comment filter, fixes #640
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 @@ -52,6 +52,7 @@ Ext.define('PartKeepr.PartFilterPanel', { statusFilter: null, conditionFilter: null, internalPartNumberFilter: null, + commentFilter: null, /** * Initializes the component @@ -96,7 +97,8 @@ Ext.define('PartKeepr.PartFilterPanel', { this.footprintFilter, this.statusFilter, this.conditionFilter, - this.internalPartNumberFilter + this.internalPartNumberFilter, + this.commentFilter ] }; @@ -184,6 +186,7 @@ Ext.define('PartKeepr.PartFilterPanel', { this.conditionFilter.setValue(""); this.internalPartNumberFilter.setValue(""); + this.commentFilter.setValue(""); this.onApply(); }, @@ -442,6 +445,11 @@ Ext.define('PartKeepr.PartFilterPanel', { anchor: '100%' }); + this.commentFilter = Ext.create("Ext.form.field.Text", { + fieldLabel: i18n("Comment"), + anchor: '100%' + }); + }, /** * Applies the filter parameters to the passed extraParams object. @@ -601,6 +609,14 @@ Ext.define('PartKeepr.PartFilterPanel', { value: "%" + this.internalPartNumberFilter.getValue() + "%" })); } + + if (this.commentFilter.getValue() !== "") { + filters.push(Ext.create("Ext.util.Filter", { + property: 'comment', + operator: "LIKE", + value: "%" + this.commentFilter.getValue() + "%" + })); + } return filters; } });