Drop-down Menu?

This forum contains topics that were moved from Get Satisfaction
Lucy
Posts: 0
Joined: Sun Mar 09, 2014 2:16 am

Drop-down Menu?

Post by Lucy »

Hello,

I'm using the Select component as a menu, but how do I go to a specific page when certain value is selected? Similar to a drop-down navigation. Right now, the individual values in the Select component can't be differentiated when navigating.

Thank you.

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Drop-down Menu?

Post by Igor »

Hello,

Please use this code on select menu component value change event:
pre
code
var navPage=Appery("mobileselectmenu").find(":selected").text().trim();
Appery.navigateTo(navPage,{});
/code
/pre
where "mobileselectmenu" - select menu component name.

Lucy
Posts: 0
Joined: Sun Mar 09, 2014 2:16 am

Drop-down Menu?

Post by Lucy »

I'm a bit confused.

The Select component is called "selecthotels". It has 3 drop down values...1, 2, 3 that people can select from. Once 1 is selected, it should take users to another page, let's say 1a.html for example. Once 2 is selected from the drop down, it'll take users to 2a.html, and so forth. In the script you wrote above, how do I direct to individual pages after selecting individual values and not just using the Select component as a whole?

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Drop-down Menu?

Post by Igor »

For the select menu set label text and label value.
Image
Use this code on on select menu component value change event:
pre
code
var navPage=Appery("select_menu").find(":selected").val();
Appery.navigateTo(navPage,{});
/code
/pre

Lucy
Posts: 0
Joined: Sun Mar 09, 2014 2:16 am

Drop-down Menu?

Post by Lucy »

Thank you for your help!

RK
Posts: 0
Joined: Sat May 23, 2015 6:40 pm

Drop-down Menu?

Post by RK »

Hi,
Can I not use "Selected" event to do this instead of "Value change"?

My problem is that the drop down values come in from database. And if I select the first value in the drop down list, the action defined on the event does not get executed. Any help will be greatly appreciated.

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

Drop-down Menu?

Post by Yurii Orishchuk »

Hello,

You need to use "Value change" event handler to handle a moment when value in this select component was changed.

Regards.

RK
Posts: 0
Joined: Sat May 23, 2015 6:40 pm

Drop-down Menu?

Post by RK »

Hi, don't think my question was understood. I am populating a set of values from the database. Now after that if I select the first value, nothing happens on value change event. From 2nd value onwards in the list , it works fine. Do I start with empty value at the start of the list to get over this situation?

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

Drop-down Menu?

Post by Yurii Orishchuk »

Hello,

What i tried:

1 Populate select with service datasource.

2 After select was populated - click on it and change value to any item from suggested list.

3 Get "Value change" event.

May be you mean you don't have "value change" after service populated your select? If so - you can trigger it with following way:

1 Add to your service(which populates your select) success event handler(should be after "mapping" event handler.

2 Populate it with following JS code:

pre

//Where "mobileselectmenu_141" is your goal select component.
Apperyio("mobileselectmenu_141").change();

/pre

Regards.

Post Reply