Json combined search action

QuestionsJson combined search action
Pedro Couto asked 5 years ago

Good morning, i has updated my version of your phpgrid to last version as recommended, by you , and is great, but i got a little problem i can not find how to fix.

i´m using a search form to search data between dates, and simultaneously the filter row for each field. the problem is that one filter cancels to the other. Is there any way to use both conditions like an “AND”.

thank you for your support, best regards.

 

7 Answers
Abu Ghufran Staff answered 5 years ago

You can review this code which uses datefrom and dateto fields to filter grid.

http://phpgrid.org/demo/demos/search/search-form.phps

Line 268

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Pedro answered 5 years ago

Good Morning, Abu.

Thank you very much for your response.

May be i didn´t explain the situation very well , sorry.

I took a look to the sample you sent before.

the problem is that , and even in this demo happens, if you choose a range of date, and you press apply in the search form, this works displaying the data between dates correctly, but if after that, you select a value in the filters down the fields, the search form is not acting any more, displaying data that are out of the dates selected.

what i´m looking for is that the data searched in the filter match with the date in the search form simultaneously.

i hope i explained the situation better this time.

thank you for your great support.

best regards.

Abu answered 5 years ago

I understand now, i’ll prepare a demo and then update you back.

Abu Ghufran Staff answered 5 years ago

I’ve done some research on this but currently it’s not doable. External search is independent and may not work with toolbar auto-filters. Even if we merge the postData filters using JS in external search code, then the vice versa is not possible (i.e. autofilter will not respect the external search filters and implementing it is a big change in library)

So, it’s better disable autofilter and globalsearch when using external search form.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Pedro answered 5 years ago

Thank you very much, Abu.

Finally i opted for an alternative, that is use the control datarangepicker in the toolbar autofilters, but i still have a litle problem, that is the datetime format, if i get a range, for instance 01-08- 2019 to 20-08-2019, the problem is that the real search is 01-08- 2019 00:00:00 to 20-08-2019 00:00:00, what i´m looking for is 01-08- 2019 00:00:00 to 20-08-2019 23:59:59 in order to include the movements of the last date, do you see any solution ?

best regars.

 

Abu answered 5 years ago

Emailed you an update.

Pedro answered 5 years ago

It works Perfect. Thank you very much Abu. Great Support

Your Answer

10 + 16 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?