Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

saving labels to array

Hi Igor,
new error, on green save button

Image

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

saving labels to array

Michael,

Could you clarify please about app logic, how should it works? It seems that you save service responce to the localStorage variable and on "Save" button click you are trying to put the same data to the same DB.

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

saving labels to array

Hi Igor,
OK, the app logic is what I checked first with Katya, at the begining of this thread,

what I am trying to do is,
I have a collections of companies in db,
on choose screen the user chooses a town and then a company,
when he clicks save Green button the 5 labels are saved to localstorage and then run js to create array,
then it runs post service to favorites in db,

the reason for the js in mapping is to allow mapping of the labels to the collapsible block when the button favorite taxi button is clicked

hope that makes sense

thx

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

saving labels to array

Please share DB with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a.

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

saving labels to array

shared Igor

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

saving labels to array

I don't know all app logic but as for me it will be better if you have additional field "favorites" in you collection and when user click "save" you increase this counter field. After that you can use simple where clause query to get the most favorites data that you need.
Another way you can save only id to another collection not all five fields and get data using id from main collection.

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

saving labels to array

Thanks Igor,
this is bad news, this is why I checked logic 5 days ago.

if i save companies id to user collection in col, would it need to be an array? can I query the five col within an array of ids and map them to labels in collapsible block?

thanks for your time on this

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

saving labels to array

We'll find the way how to fix this error but unfortunately it will take some time.

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

saving labels to array

OK Igor,
please try not to take too much time, I'm late and I may loose this one

thanks again

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

saving labels to array

Would this would work,
when user clicks save "green button" labels are saved to localstorage along with user id,
run put service to favorites collection and map to 5 cols and user id

then when user clicks favorite taxis, run where on user id to "favorites collection",
map response to collapsible block grid and labels.

Return to “Issues”