Guidance on Dynamic Filtering, Sorting, and Pagination
Hello Ash community,
I'm implementing standard filtering, sorting, and pagination features for my contacts module and have defined a read action as follows:
In my controller, I parse incoming parameters with default values:
I invoke the function as:
I'd like to understand how to pass these parameters to effectively filter, sort, and paginate the contacts list. Specifically:
- How can I apply a case-insensitive search filter to multiple attributes and only when search_query is present?
- What's the recommended way to implement dynamic sorting based on sort_by and sort_dir?
- How should I handle pagination using current_page?
- Are there best practices for sanitizing and validating these parameters before applying them?
Any guidance or examples on implementing these features would be greatly appreciated.
Thanks in advance!
I'm implementing standard filtering, sorting, and pagination features for my contacts module and have defined a read action as follows:
In my controller, I parse incoming parameters with default values:
I invoke the function as:
I'd like to understand how to pass these parameters to effectively filter, sort, and paginate the contacts list. Specifically:
- How can I apply a case-insensitive search filter to multiple attributes and only when search_query is present?
- What's the recommended way to implement dynamic sorting based on sort_by and sort_dir?
- How should I handle pagination using current_page?
- Are there best practices for sanitizing and validating these parameters before applying them?
Any guidance or examples on implementing these features would be greatly appreciated.
Thanks in advance!
