This topic is locked
[SOLVED]

 Auto Assign Search Type In Search Panel

3/7/2013 8:49:02 AM
PHPRunner General questions
P
p1nr author

I'd like to make my date fields to automatically select "Between" instead of "Contains" in my search panel. Any idea on how to do this?

P
p1nr author 3/7/2013



http://www.asprunner.com/forums/topic/17530-automatically-search-between-dates-on-advanced-search-page/



Tried this link before, but I need it for the search panel and not the advanced search, as I have that disabled. I added the code to my report javascript onload event and got a loading screen that never when away, then I tired it in my search page and nothing happened.

Sergey Kornilov admin 3/7/2013

I see what you saying. To manipulate search panel use SearchField and SearchController objects.

Example: http://xlinesoft.com/phprunner/docs/field_setoption.htm

P
p1nr author 3/11/2013

Thanks for your prompt reply.
This looks like what I need but I'm having difficulties getting it to work. Should I add this to the onLoad on the search page? I've created a report as oppose to a table for the output. Does this make a difference?

P
p1nr author 3/11/2013



Thanks for your prompt reply.
This looks like what I need but I'm having difficulties getting it to work. Should I add this to the onLoad on the search page? I've created a report as oppose to a table for the output. Does this make a difference?


Basically what I'm saying is that I just copied and pasted the code and it just stayed stuck on my loading screen.

Sergey Kornilov admin 3/11/2013

Copying and pasting sample code is not enough. You need to make sure you applying this code to correct page (List page) and that all field names are correct.

P
p1nr author 3/12/2013

Yes, that is where my confusion is:

var srch = pageObj.getSearchController();

var field = srch.getSearchFields()[0];
field.setOption(Runner.search.options.BETWEEN);


Looking at the code above, I'm not sure where to reference the field name?

P
p1nr author 3/13/2013

Anybody know the answer? Nothing I try works.

Sergey Kornilov admin 3/13/2013

I would suggest to post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.

P
p1nr author 3/18/2013

I would like to, but my boss is very picky when it comes to privacy.

I don't mind playing around with the code myself, but nothing that I've tried thus far works.

If someone could just let me know where I reference my fields/page id/etc. then I will try it out on my end.
Thanks for your help.

G
gudon 3/18/2013

I just had a naive idea.
let me suppose your project list page is: myproject_list.php; your date field name is: mydate.
In case you want your list page to have your date field selected in the search panel and search parameter be BETWEEN, Just redirect to your page to:
myproject_list.php?q=(mydate~between~).
Hope it helps.

P
p1nr author 3/19/2013



I just had a naive idea.
let me suppose your project list page is: myproject_list.php; your date field name is: mydate.
In case you want your list page to have your date field selected in the search panel and search parameter be BETWEEN, Just redirect to your page to:
myproject_list.php?q=(mydate~between~).
Hope it helps.


Naive? More like innovative. Thank you, it worked!

P
p1nr author 3/19/2013



Naive? More like innovative. Thank you, it worked!


The only issue is that the redirect will display records even though 'no records' is checked.