I am using Laravel 5.5 and trying to find out if there is a streamlined way to filter / search through a database table in an html form / view.
I have had no trouble getting a table to show up, and also have been able to filter results easily enough by passing a variable into the url with:
onchange = "javascript:window.location"
That sort of thing seems to work pretty well with one drop down, but if I have 5 drop downs, and I want each one to change which records are displayed on the screen, and each one to not have to be supplied, I have been having issues.
Is there an easy way to do this? So far the best thing I have come up with is adding an apply button, and when you click the apply button, it uses the selected items from the dropdown menus to save a string into a variable, and then using the string variable to to reload the url with the string attached, and then unparse the string back into several variables in the controller.. but is that really necessary?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire