Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

More Detail on using the select menu

Hi,

Could you please clarify what value is read from mobileselectmenu_165?
Please add the following JavaScript to parameter 'where': prereturn '{"Book": {"$regex": "A"}}';/pre

eascards
Posts: 0
Joined: Mon Jul 14, 2014 2:42 am

More Detail on using the select menu

You select what book you want to see in the mobile select menu. I added the code and now it at lease takes the all of the calves away but it still doesn't show the ones that should be there.

Also, I have a regular search page so how can I get it to only search for calves in the book selected on a different page?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

More Detail on using the select menu

Hi Eascards,

Please try this code:

pre

var whereObject = {"Book":{"$regex":"^" + value, "$options":"i"}};

return JSON.stringify(whereObject);

/pre

Regards.

eascards
Posts: 0
Joined: Mon Jul 14, 2014 2:42 am

More Detail on using the select menu

Working great!! Thanks for your help!

eascards
Posts: 0
Joined: Mon Jul 14, 2014 2:42 am

More Detail on using the select menu

How can I get it so that when I open the search page, it only searches through the calves within the book selected on the previous page?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

More Detail on using the select menu

Hi eascards,

You need to store bookId on previous page to the LSV.

See details: http://devcenter.appery.io/tutorials/...

Then use this LSV in this "where" parameter in accordance to your needs.

Regards

eascards
Posts: 0
Joined: Mon Jul 14, 2014 2:42 am

More Detail on using the select menu

I created the LSV event but when I link it to the "where" parameter, it gets rid of what was linked there already, therefore making the whole search not work.
This is the mapping for the search page:
Image

This is what I did to set the LSV:
Image

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

More Detail on using the select menu

eascards,

Ok, no problem, leave current link and just edit your JS inside this "where" parameter.

You need to pass in this object some specific search criteria which is you need with value from LSV.

You can access to this LSV with following code:

pre

var bookid = localStorage.getItem("bookid");

/pre

Then you can use "bookid" js variable.

Regards.

eascards
Posts: 0
Joined: Mon Jul 14, 2014 2:42 am

More Detail on using the select menu

Without the code that I had there before,

return '{"calf_id":"'+value+'"}';

it doesn't work.

When I add the new code, it get an error. Image

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

More Detail on using the select menu

Hello,

You try to define bookid variable after you return value and exit function. Code after return will never execute.

Return to “Issues”