- This topic has 11 replies, 3 voices, and was last updated 10 years, 1 month ago by support-octavio.
-
AuthorPosts
-
Philip!!!MemberHi octavio.
I would like to add in my book application a bookmark option
so i can save the current page am reading.
(perhaps in another screen called “my bookmarks”)how can i implement something like that?
Code_AMemberEasiest solution for your situation may be to save the bookmarks to localStorage, maybe using an array or csv type format (book id, page#). Assuming you want to be able to save multiple bookmarks.
Search the forums for localStorage if you are unsure how to implement. There are plenty of examples, like CincyPlanet’s in the how-to forum.
Philip!!!MemberI didn’t find something that helped me.
Philip!!!MemberHi Octavio
Any tips?
Philip!!!MemberHi Octavio
Any ideas on how to implement a bookmark function?
save my current page in a screen, and be able to save multiple Bookmarks?
Code_AMemberHow are your app screens setup? Do you have multiple screens? Are you using a multipage widget? Are you loading your screen content dynamically from a server? This information is needed to provide you direction on how to save the page.
You can use localStorage to do this. It may be as simple as saving the screen name or the multipage page name as the bookmark.
Can you post an example?
Philip!!!MemberHi code A
In most of my app i am using multipage widgets but also a part of it has multiple screens.
I am not using a server. everything is in the apk file if this is the information you need , so i think the answer is static loading.
i can not post an example here, but if it is necessary i can send you one in privet somehow.
Code_AMemberTo save a multipage screen name to localStorage, try this:
var activePage = $(newPage).attr('id'); //you can also use oldPage here if you want to know the previous page localStorage.setItem('bookmark',activePage);
To load a multipage screen from localStorage, try this:
var bookmark = localStorage.getItem('bookmark'); phoneui.gotoMultiPagePage('m1-<your-file-name>-multiPage1', 'SET_PAGE', ' + bookmark +', 'FADE');
I have not tested this code. Just pieced it together real quick to give you an idea of how it’s done. Hopefully this helps to get you started.
support-octavioMemberHi philip,
I shared an small example with you, which I think also will be helpful for this functionality.
Philip!!!MemberHi Octavio.
The example you post , it regards another topic which it helped by the way.
Here i am trying to implement a bookmark function, i am trying to find a
way to save a page or screen and have them all displayed (maybe like a link??)in one screen which i am gonna call “my bookmarks”
Code_AMemberYou can use a list widget to dynamically display all your saved bookmarks.
support-octavioMemberAgree with Code A. You can find an example about it here: http://www.genuitec.com/support-genuitec/viewtopic.php?f=14&t=6217
Note that customizing to fit your requirements needs proficient skills with javascript and websql. -
AuthorPosts