Table should be blank in default
Actually I need the table to blank in default. It should be filled only with the search filter result. It should be blank again while using "reset filter". Is this possible?
12 Replies
$this->activeFilters not found
Thank you @z3d0x I am trying this in custom page. Hence, I don't have List page. So Iam getting error
try
$this->tableFilters
insteadThanks a lot. It works. Let me try apply the logic...
If possible please do share your solution here for future reference
No, the $this->tableFilters not helped me. Why because, I need to know weather the request triggered from any filters or 'reset filter'. My requirement is only to show the respective record when I am searching through filter form. Otherwise the table should be blank. Here, the "$this->tableFilters" is always there and I am getting count of it as 1.
I want to execute $query->whereNull('id') in default and while using 'reset filter' other wise it should return the records based on by filter value.
I need to implement this requirement in many pages... Please help me.
Thanks a lot to spending your valuable time here.
tableFilters should always be empty unless some have been applied?
Have you set some filter defaults/
No defaults, this is what I have
So don't you want to the do a check on code->transfer_code where not null?
Yes, we can do it in that way. But, if we have few more filters, then we need to check every thing right?
Please correct me if I am wrong...
Ahh I see, I would get the filters and loop and check if they are all NULL, should be fairly quick and easy.
Usually the filters are adding the conditions with the existing query. But, I want to frame the query with only the filter values.
Thanks @toeknee_iom for your valuable time. Yes, I will do it in that way.
Please continue this post chain, If anyone having different approach... Thanks again.
Finally I did in this way
Helper function: