Page 1 of 3

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

Posted: Tue Nov 12, 2013 2:38 pm
by Marc6388140

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


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

Posted: Tue Nov 12, 2013 3:20 pm
by Kateryna Grynko

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?


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

Posted: Tue Nov 12, 2013 6:34 pm
by Marc6388140

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.


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

Posted: Tue Nov 12, 2013 9:50 pm
by Marc6388140

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


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

Posted: Tue Nov 12, 2013 9:53 pm
by Illya Stepanov

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


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

Posted: Sat Nov 16, 2013 12:49 pm
by Marc6388140

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


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

Posted: Sat Nov 16, 2013 3:45 pm
by maxkatz

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


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

Posted: Sat Nov 16, 2013 6:04 pm
by Marc6388140

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.


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

Posted: Sat Nov 16, 2013 7:42 pm
by Marc6388140

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


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

Posted: Sat Nov 16, 2013 7:51 pm
by Alena Prykhodko

Hello Marc, you will need to code it, this should help https://getsatisfaction.com/apperyio/...