-
-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi Filtering improvement to current filter plugin #302
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to remove console.logs
…h first filter only
this.addEventListener('headerclick', headerclick); | ||
this.addEventListener('aftersourceset', aftersourceset); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you remove this?
it was supposed to filter when we apply new data source if we have any filter
// check is filter event prevented | ||
const { defaultPrevented, detail } = this.emit('beforefiltertrimmed', { collection, itemsToFilter, source: items }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here you removed a way to override filter externally, when you removed details
src/plugins/filter/filter.plugin.tsx
Outdated
continue; | ||
} | ||
propFilterSatisfiedCount++; | ||
} else if (filterData.relation === 'and') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need else if here? can't it be just else and so if no relation it'll be treated as and?
|
||
const aftersourceset = async () => { | ||
const filterCollectionProps = Object.keys(this.filterCollection); | ||
if (filterCollectionProps.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be just filterCollectionProps.length
src/plugins/filter/filter.plugin.tsx
Outdated
if (filterCollectionProps.length > 0) { | ||
// handle old way of filtering by reworking FilterCollection to new MultiFilterItem | ||
// since id is generated locally, we don't want to conflict with other filters by starting at 0 | ||
let filterIdStart = 1000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to make time based, 1000 seems just a random number
add multi filters to a column. can ba and or or relation or both.