Skip to content

Commit

Permalink
Added filter for internalPartNumber, relates to #501
Browse files Browse the repository at this point in the history
  • Loading branch information
Felicitus committed Nov 26, 2015
1 parent 380d118 commit 4952121
Showing 1 changed file with 17 additions and 1 deletion.
Expand Up @@ -50,6 +50,7 @@ Ext.define('PartKeepr.PartFilterPanel', {
footprintFilter: null,
statusFilter: null,
conditionFilter: null,
internalPartNumberFilter: null,

/**
* Initializes the component
Expand Down Expand Up @@ -92,7 +93,8 @@ Ext.define('PartKeepr.PartFilterPanel', {
this.manufacturerFilter,
this.footprintFilter,
this.statusFilter,
this.conditionFilter
this.conditionFilter,
this.internalPartNumberFilter
]
};

Expand Down Expand Up @@ -178,6 +180,7 @@ Ext.define('PartKeepr.PartFilterPanel', {
this.statusFilter.setValue("");

this.conditionFilter.setValue("");
this.internalPartNumberFilter.setValue("");

this.onApply();
},
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}
});

0 comments on commit 4952121

Please sign in to comment.