Skip to content

Commit

Permalink
Added manufacturer part number filter, fixes #489
Browse files Browse the repository at this point in the history
  • Loading branch information
Felicitus committed Nov 28, 2015
1 parent 71dd507 commit e3c9f6a
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Ext.define('PartKeepr.PartFilterPanel', {
stockFilter: null,
partsWithoutPrice: null,
distributorOrderNumberFilter: null,
manufacturerPartNumberFilter: null,
createDateField: null,
createDateFilterSelect: null,
createDateFilter: null,
Expand Down Expand Up @@ -91,6 +92,7 @@ Ext.define('PartKeepr.PartFilterPanel', {
this.distributorOrderNumberFilter,
this.distributorFilter,
this.manufacturerFilter,
this.manufacturerPartNumberFilter,
this.footprintFilter,
this.statusFilter,
this.conditionFilter,
Expand Down Expand Up @@ -161,6 +163,7 @@ Ext.define('PartKeepr.PartFilterPanel', {
this.categoryFilter.setValue({category: 'all'});
this.stockFilter.setValue({stock: 'any'});
this.distributorOrderNumberFilter.setValue("");
this.manufacturerPartNumberFilter.setValue("");

this.createDateFilterSelect.setValue("");
this.createDateField.setValue("");
Expand Down Expand Up @@ -280,6 +283,11 @@ Ext.define('PartKeepr.PartFilterPanel', {
anchor: '100%'
});

this.manufacturerPartNumberFilter = Ext.create("Ext.form.field.Text", {
fieldLabel: i18n("Manufacturer Part Number"),
anchor: '100%'
});

this.createDateField = Ext.create("Ext.form.field.Date", {
flex: 1
});
Expand Down Expand Up @@ -534,6 +542,14 @@ Ext.define('PartKeepr.PartFilterPanel', {
}));
}

if (this.manufacturerPartNumberFilter.getValue() !== "") {
filters.push(Ext.create("Ext.util.Filter", {
property: 'manufacturers.partNumber',
operator: "LIKE",
value: "%" + this.manufacturerPartNumberFilter.getValue() + "%"
}));
}

if (this.distributorFilterCheckbox.getValue() === true) {
filters.push(Ext.create("Ext.util.Filter", {
property: 'distributors.distributor',
Expand Down

0 comments on commit e3c9f6a

Please sign in to comment.