This topic is locked
[SOLVED]

 Change the SQL with a dropdown list box in the header of the search page

6/30/2014 9:35:26 AM
PHPRunner General questions
W
wedi author

Hello.
I use the example "Add dropdown list box with values for search" to filter the list via URL-Paramter.

What i want is an additional filter via a dropdown list box, which changes the "Main-SQL".
Example:
At the first time, the search page was opened, i change the SQL in the "After table initialized" event and add a where Clause (ParentID IN(x,y,z)). The x depents on the UserID. This works great.
In the header of the search page i want an additional dropdown list box with all ParentIDs the UserID is authorized, so he can filter the liste for every ParentID. For the Example i have 4 entries - one for IN(x,y,z) and one for x, one for y and one for z I don't want to filter the list via URL-Parameter!!
Question:

How can i change the SQL (like in "After table initialized"-event) when i select one entry in the dropdown list box?
Many thanks for your help

wedi

Sergey Kornilov admin 6/30/2014

I'm not quite sure I understand. Are you talking about List page or about Search page? If you are talking about the search page all this functionality can be achieved via "normal" search controls as opposed to adding more controls to the header. Probably you can elaborate it a little bit.

W
wedi author 7/1/2014

Okay, i try to explain more different.
I mean an additional dropdown list box in the header of the list page.

The reason is: with 2 mouseclicks (one for dropdown and one for select) it is very easy to handle for our users.
In our application we don't use the special search page - only the searchfield with the magnifier-button.
And: nobody should see, which ParentID (in my example x, y or z) stands for x, y or z! This is, what you could see, if you filter it with URL-Parameter (like the example "Add dropdown list box with values for search").
I hope you understand what i want. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=75125&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />
wedi

W
wedi author 7/7/2014

Okay, i use the filter via a dropdown list box on the quick search panel.
thanks wedi