Page 1 of 2

How to create a "favorites" page?

Posted: Tue Oct 14, 2014 3:53 pm
by Xavier U

I am building an app that has a list of drop down text. Ideally, in the text boxes I would have a button that users can click so they can "favorite" the text and easily retrieve it in their "favorites" page later.... How exactly is this done? Many thanks!


How to create a "favorites" page?

Posted: Tue Oct 14, 2014 4:32 pm
by Evgene Karachevtsev

Hello Xavier,

You may save the selected values in local storage, and when you open the page second time you may they take them from there.


How to create a "favorites" page?

Posted: Wed Oct 15, 2014 5:08 pm
by Xavier U

Can you explain in more detail... Sorry I am still new to this.. I have a favorites button and a favorites page, how do I get them to sync?


How to create a "favorites" page?

Posted: Wed Oct 15, 2014 5:33 pm
by Evgene Karachevtsev

Hello Xavier,

  1. Please give us a screenshot of the page with favorites, to better understand how you to make it.

  2. Please look here to find out how to work with local storage http://devcenter.appery.io/documentat...

    If you have a list and each item has a button "add to favorites", then when you click you should find the nearest text refers to this button and save to local storage.
    And then, on the page "favorites" you take all the previously stored values from local storage and display on page


How to create a "favorites" page?

Posted: Wed Oct 15, 2014 6:04 pm
by Xavier U

How to create a "favorites" page?

Posted: Wed Oct 15, 2014 6:05 pm
by Xavier U

Above are the two screen shots of what I've done, the bottom bar is where I would ideally like people to click and "favorite" then I would like their favorites to show up on the favorites page (image 2).


How to create a "favorites" page?

Posted: Wed Oct 15, 2014 7:05 pm
by Evgene Karachevtsev

Xavier,

I can see a button for navigating to favorites (button "favorites") below. And to add to the list of the favorites is it needed to click on the item itself on a page?


How to create a "favorites" page?

Posted: Thu Oct 16, 2014 3:57 pm
by Xavier U

Image Image
Yes, our plan is to use a button which the user can click and add the "prayer" or collapsible set to the favorites page. But we do not know how that is done...


How to create a "favorites" page?

Posted: Fri Oct 17, 2014 9:10 am
by Kateryna Grynko

Hi Xavier,

  1. Do you want to get a favorites list from database or does it already exist in builder page?

  2. What do you want to save? You can save a header name from a Collapsible component this way:

    2.1 Add a model 'favorites' of array type in section Model and storage

    2.2 Add a local storage variable of type 'favorites'

    2.3 For Add/Delete buttons add an attribute data-rname (in more properties section) and specify a header name as an attribute value.

    Run the following code on button click:prevar rname = $(this).data('rname'),
    currentFavorites = Appery.storage.favorites.get();

    if ( !currentFavorites ) {
    // Add the 1st entry
    Appery.storage.favorites.set([ rname ]);
    } else {
    // Check for duplicates
    if ( !_.contains( currentFavorites, rname ) ) {
    currentFavorites.push( rname );
    Appery.storage.favorites.set( currentFavorites );
    }
    }/pre2.4 When opening the next page (favorites) you will work with local storage data.


How to create a "favorites" page?

Posted: Tue Nov 11, 2014 6:17 pm
by Godwin Pinto

I have a similar question

  1. I want the a page in the builder to be added as favorites

  2. And that page should be stored on local storage

    how do I go about it?