Page 1 of 1

SelectMenu component options

Posted: Mon Dec 09, 2013 10:56 am
by Jordi Niubo

Hi

I have a selectMenu with some options ("A", "B","C", ....);

In custom properties i can select the option selected. This option will be the first selected option in all time.

My questions:

1) I would like to design something that without click in the selectMenu the option selected will change. My idea is to have the selectMenu in the second Page of the project and this page can load diferent data. Depending of the data, the first option selected will change. What is the function to do this?

2) I read some documentation but some UI components have different functions. There are any Documentation about specific functions to work with JS?


SelectMenu component options

Posted: Mon Dec 09, 2013 11:34 am
by Kateryna Grynko

Hi Jordi,

[quote:]I would like to design something that without click in the selectMenu the option selected will change. My idea is to have the selectMenu in the second Page of the project and this page can load diferent data. Depending of the data, the first option selected will change. What is the function to do this?
[/quote]You would need to use custom JavaScript code. I'll check how you can do this.

[quote:]I read some documentation but some UI components have different functions. There are any Documentation about specific functions to work with JS?[/quote]All the specific information can be found in our documentation. Do you have any specific question?


SelectMenu component options

Posted: Mon Dec 09, 2013 11:49 am
by Jordi Niubo

Hi Katya

Now I only have this question about the selectMenu but I would like to learn more about this.

In some tutorials I have seen diferents functions. As a example: http://docs.appery.io/tutorials/build...
.append('​' + newData + '');
.selectmenu('refresh');

There are any documentation about this for each UI component? Is for learning and be more independent. I have not seen any documentation about this. Posible I searched in wrong section.

Thanks


SelectMenu component options

Posted: Mon Dec 09, 2013 8:00 pm
by Maryna Brodina

Hello! See FAQ #9 http://docs.appery.io/getting-started/. You can refer to jQuery, jQuery Mobile docs to get more information.


SelectMenu component options

Posted: Fri Dec 13, 2013 11:39 am
by Jordi Niubo

Hi Maryna

Thanks, this functionality works!

For other people that possible have the same problem, is easy.

Solution:
var selected = localStorage.getItem('item'); //"item" is a local variable
var list = $('[name=input_list]');
list.val(selected);
list.selectmenu('refresh');

Thanks for your time Maryna and Katya


SelectMenu component options

Posted: Fri Dec 13, 2013 2:14 pm
by Maryna Brodina

Hi, thank you for sharing that!