Xavier U
Posts: 0
Joined: Tue Oct 14, 2014 3:53 pm

How to create a "favorites" page?

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!

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

How to create a "favorites" page?

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.

Xavier U
Posts: 0
Joined: Tue Oct 14, 2014 3:53 pm

How to create a "favorites" page?

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?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

How to create a "favorites" page?

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

Xavier U
Posts: 0
Joined: Tue Oct 14, 2014 3:53 pm

How to create a "favorites" page?

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).

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

How to create a "favorites" page?

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?

Xavier U
Posts: 0
Joined: Tue Oct 14, 2014 3:53 pm

How to create a "favorites" page?

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...

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How to create a "favorites" page?

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.

Godwin Pinto
Posts: 0
Joined: Sun Nov 09, 2014 6:26 pm

How to create a "favorites" page?

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?

Return to “Issues”