Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Item & user datatable filters #415

Merged
merged 3 commits into from
Nov 19, 2021
Merged

Item & user datatable filters #415

merged 3 commits into from
Nov 19, 2021

Conversation

patriksh
Copy link
Contributor

@patriksh patriksh commented Oct 4, 2021

manage_item_search_order_by & manage_user_search_order_by - for changing default order of results in the tables.

manage_user_search_conditions - similar to existing filter for item table.

manage_item_search_with_filters & manage_user_search_with_filters - if any filters are added with appropriate hooks, this filters should be utilized as well so the "Reset filters" button shows

@patriksh
Copy link
Contributor Author

@navjottomer Could you please incorporate this in the new release? I need it for some plugins so it would be nice if they worked without core edits.

@navjottomer
Copy link
Member

I didn't get enough time to check the PR, still working on custom fields.

@navjottomer
Copy link
Member

I checked it and here is a suggestion.
Isn't better to merge two filter manage_items_search_conditions and manage_item_search_order_by into a single datatable_item_search filter.
Same for the User Datatable.

@patriksh
Copy link
Contributor Author

@navjottomer Yeah for item datatable the order filter is actually not needed at all, since we pass mSearch in manage_item_search_conditions, we can just call order() on it.

It's different in users datatable though. There we'd probably have to rewrite the search method from User model class.

@navjottomer
Copy link
Member

Okay I'll check the user data table search

@navjottomer
Copy link
Member

Okay, I checked and I see what you were saying about the difference. They are different sure but the whole object can be passed through a hook, see lines 94,95 for reference and properties can be overwritten that way. Check if that work.

@patriksh
Copy link
Contributor Author

@navjottomer I'm passing the object as requested, works nicely with both conditions and order.

@navjottomer navjottomer merged commit 7fe26a5 into mindstellar:develop Nov 19, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants