- This topic has 11 replies, 3 voices, and was last updated 10 years, 9 months ago by
Philip!!!.
-
AuthorPosts
-
Philip!!!MemberHi
Is it possible you guys to add an option to the combo box widget so we can choose the permanent title of the combo box?
for example, i want to add a combo box to my home screen and name it “menu”, so after i navigate in my app and then return to my home screen it will not display the name of the page i last visit, but its title … “menu”.
September 22, 2014 at 1:32 pm #351674
support-octavioMemberHi philip,
I am kind of confused with your question. Does your app navigate to secondary screens depending on selected combobox option? If yes, you can add the code to “reset” your combobox, see this thread: http://www.genuitec.com/support-genuitec/viewtopic.php?f=8&t=3820
After modifying the snippet you can add it to your phoneui.postPageTransition function in the <project>_custom.js file.
Let me know if you need further assistance.
September 22, 2014 at 2:59 pm #351677
Code_AMemberI think I might be confused. Why is your combobox displaying the last page you visited? Is this the selected value in the combobox?
If you want a permanent title, then you can place a label above it. If you want to clear the combobox selection then you can handle that programmatically. Is that what you are trying to do?
September 22, 2014 at 3:16 pm #351678
Philip!!!MemberOk
take a look at the screenshots .
the first label is menu , because i want my user to know that this is the menu of my app.
then i want to navigate at page one, so i choose from my combo box
“PAGE 1” and i navigate at page 1.then when i go back to my home screen in the combo box is “PAGE 1”
but i want it to display “MENU” again.
i hope i explain it better this time.
Attachments:
You must be logged in to view attached files.September 22, 2014 at 4:00 pm #351680
Code_AMemberTry using this code on your page transition back to home (index being the number of the item you want to select):
$('select[name="combobox1"] option:eq(index)').attr('selected','selected')
September 22, 2014 at 4:26 pm #351682
Philip!!!MemberI am not sure i am following you because i am new to this.
where do i add the code?
Can i add it in to my project js file?->index being the number of the item you want to select
I don’t understand that at all .
What item i want to select?Thank you for your time and effort
September 22, 2014 at 5:57 pm #351686
support-octavioMemberHi philip,
Can you share the code you are using to navigate between screens? Seeing it will allow us to provide better advice.
September 23, 2014 at 3:00 am #351693
Philip!!!MemberHi Octavio.
I am using this code:
var pageId = $(‘select[name=”combobox1″]’).val();
phoneui.gotoPage(pageId, ‘FADE’);I followed this tutorial to implement:
https://www.youtube.com/watch?v=U2ujNBpw34Aas you will notice at the tutorial as well when he returns to his home screen
the combo box displays the name of the screen he last visit.September 23, 2014 at 3:00 pm #351705
support-octavioMemberHi Philip,
As Code A suggested you can use that snippet in the phoneui.postPageTransition function in the _custom.js file:
$('select[name="combobox1"] option:eq(0)').attr('selected','selected') //used 0 as index assuming your MENU label is the first one. phoneui.preprocessDOM('#screen-name'); //force UI to update
September 23, 2014 at 4:45 pm #351709
Philip!!!MemberHi Octavio
It doesn’t work , probably i am doing something wrong.
is this how i am suppose to add the code?:phoneui.postPageTransition = function(newScreenId) {
localStorage.setItem(“lastscreen”,”products”);
$(‘select[name=”combobox1″] option:eq(0)’).attr(‘selected’,’selected’)
phoneui.preprocessDOM(‘#screen-name’);
}September 23, 2014 at 6:14 pm #351712
support-octavioMemberHi philip,
You have to use your screen id:
@philip wrote:option:eq(0)’).attr(‘selected’,’selected’)
phoneui.preprocessDOM(‘#screen-name‘);
}Example:
phoneui.preprocessDOM('#m1-home');
September 24, 2014 at 4:40 am #351716
Philip!!!MemberHi Octavio
It worked.
-
AuthorPosts