I have a page using pdoResources to create a list. The list might become very long so I’d like the visitor to be able to have a search bar that would filter the results without navigating away from the page.
What are some search bars that can do this function and you’d recommend? Thank you in advance!
The only way I can think of to do this would be to pass the value of the search input’s contents to a snippet that would construct a ‘where’ clause for pdoResources, call pdoResources with $modx->runSnippet(), and return the results.
That looks like a better solution than mine. You might also look into ExtJS/modExt which is available in MODX and has some nice built-in features for filtering by columns as you see in the Manager.
I’ve used the JQuery plugin “Select2” before to great effect. It’ll let you pull results via AJAX so not everything is loaded up front. Although perhaps that is what you want.
Create tpls to format the output as required by the selected plug in, add the JS and the client end can handle the functionality.
I am might switch them to Bootstrap Table. Seems to work faster with large datasets and has Bootstrap, Zurb Foundation, and more CSS styling available.