Skip to content

Commit

Permalink
Add custom search function property to DataSet
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterjandebruyne committed Aug 24, 2022
1 parent 405efff commit 1b8c3bb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Dataset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ export default {
dsSortAs: {
type: Object,
default: () => ({})
},
dsSearchFc: {
type: Function,
default: function () {
return (dataset, searchVal) => {
return dataset.filter((entry) => { return findAny(this.dsSearchIn, this.dsSearchAs, entry.value, searchVal) })
}
}
}
},
data: function () {
Expand Down Expand Up @@ -157,7 +165,7 @@ export default {
// Search it
if (dsSearch) {
result = result.filter((entry) => findAny(dsSearchIn, dsSearchAs, entry.value, dsSearch))
result = this.dsSearchFc(result, dsSearch)
}
// Sort it
Expand Down

0 comments on commit 1b8c3bb

Please sign in to comment.