Create a global search
Guys, what would be the best approach for me to take for the following resource. I need to create a screen for a global search. In the textobox I will enter the term and it will search in several models. The result must be grouped by model and must be displayed in a table. How should I do this? Thanks
10 Replies
Why do you need it in a resource? What's wrong with the global search at the top nav?
There is no way to search the table globally, as I will check several models and then return a result grouped by model. I think that in the global search of the table this cannot be done, if it is possible and you can show me how I appreciate it.
can't you use this?
So from what I saw, I can only use a Model with several relationships for this global search. And actually I need to search, for example, in the table, users, products, categories, blog, etc. And then return the result grouped by model.
check the demo app
isn't like that you want?
According to the demo application, this would be the case. But I didn't understand how to do this from the documentation in the link you gave me. She only cites a record with several relationships. Or when I use this global search, does it already get all the columns that are marked for searches in the resource tables? Another thing, is there any way I can show the search results in a table and not in a dropdown?
I've now read the documentation you gave me and I think I understand. I apologize for my questions. So I had 2 doubts. How do I disable a resource where I don't want it to be seen by global search and how can I show the result in a table, for example, or in another custom layout instead of the dropdown?
in your resource, just put;
This disables global search for resource. However, I dont have any idea about custom layout π
Thanks for your help.
I guess you could build your own page and just pass the search to the global search class and render the results yourself