Marc6388140
Posts: 0
Joined: Tue Nov 05, 2013 3:04 pm

How to add an item to "Favourites" locally in the device, not in the server?

I have a collection of items listed in my App, and I want the ability for each user to select their favorites.

For the moment I don't want to sync data of users with the server, but manage the field "IsFavorite" locally and be able to have a screen filtered by this field.

Is this possible? How can I differentiate between cloud data and local data?

Sorry about another newbie question...

Thank You,

Marc

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

How to add an item to "Favourites" locally in the device, not in the server?

HI Marc,

You can create Generic service and process data there as you need. What data do you have and what data you want to get?

Marc6388140
Posts: 0
Joined: Tue Nov 05, 2013 3:04 pm

How to add an item to "Favourites" locally in the device, not in the server?

I want to add a starred button next to every element in the list to mark the item as favorite and then I would have a view showing the items set as favorites. For that I guess I need to add a True/Flase (1,0)"IsFavourite" field in the collection, but I want each user to have their own data in their device and not sync with the cloud data base.

Marc6388140
Posts: 0
Joined: Tue Nov 05, 2013 3:04 pm

How to add an item to "Favourites" locally in the device, not in the server?

How could I use Generic service to achieve this? Any documentation?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

How to add an item to "Favourites" locally in the device, not in the server?

Hi Marc,

You can save 'IsFavourite' in localStorage.
When you'll need to display all the data from favorites - you can do it in variety of ways. E.g.

ul

liYou can directly make a request to get the items you needed. Such as by setting up the request parameter in 'where' by the data from localStorage./li

liYou can add verification in the mapping (by hiding the items which will not pass)
:: http://docs.appery.io/documentation/u.../li
liYou can use Generic service and exclude the irrelevant data in it.

:: https://getsatisfaction.com/apperyio/.../li

/ul

Marc6388140
Posts: 0
Joined: Tue Nov 05, 2013 3:04 pm

How to add an item to "Favourites" locally in the device, not in the server?

How can I keep multiple values in local storage through Set Local Storage Variable event?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How to add an item to "Favourites" locally in the device, not in the server?

You can run a different action for each key/value or use the local storage API directly.

Marc6388140
Posts: 0
Joined: Tue Nov 05, 2013 3:04 pm

How to add an item to "Favourites" locally in the device, not in the server?

But is it possible to store an array of Key/Values in the same variable? I would like to select various items and store them in the same variable to retrieve them in a list.

Marc6388140
Posts: 0
Joined: Tue Nov 05, 2013 3:04 pm

How to add an item to "Favourites" locally in the device, not in the server?

So, How can I store an array of data in the same variable?

Return to “Issues”