Ext.form.TextField problem

LabKey Support Forum (Inactive)
Ext.form.TextField problem feifei bao  2015-04-16 07:55
Status: Closed
 
Hi,

I try to do a similar filter function based on the labkey example:
https://www.labkey.org/wiki/home/Documentation/page.view?name=tutorialActionURL

While in my part, I put the user input from and the filter list in the same wiki page. So it show the search box and list at the same time. After I click the "search" button, the page updates and shows the filtered results. How can I make the search box still shows the content inputted by user in the filtered page?

Thank you very much.

Feifei
 
 
Jon (LabKey DevOps) responded:  2015-04-16 12:04
Hi Feifei,

What you will want to do is use the LABKEY.ActionURL.getParameter('parameterName') option within your Javascript code.

Source: https://www.labkey.org/download/clientapi_docs/javascript-api/symbols/LABKEY.ActionURL.html

For example, if my URL had the string &participantId=12345678 and I used:

LABKEY.ActionURL.getParameter('participantId')

The ID number 12345678 would get used within my Javascript code.

You can apply this to your search box by having someone type in a value into the box, clicking "search" which would reload the same wiki page but adding something like &searchValue= in the URL string in the address bar along with your actual value you typed in the box, then having the Javascript page pull the value into your query by using:

LABKEY.ActionURL.getParameter('searchValue')

And that will in-turn load your query with the search value you entered.

Regards,

Jon
 
feifei bao responded:  2015-04-17 14:02
Thank you so much. This function works!

Feifei