Page 1 of 1

Edit result from service

Posted: Fri Jan 17, 2014 10:53 am
by Jordi Niubo

I have a service that return all items from DDBB.

Each item have Name and Number (1,2,3,4,...99,..,).

In DDBB I have differents items with different Name and different items with the same Name .

The idea is: list all items but if in DDBB exist 2 or more items with the same name, list only one with the summatory.

Ex:
In DDBB:
Dani, 3
Albert,3
Jeff, 5
Dani, 8

List:
Dani, 11
Albert,3
Jeff, 5

My idea is call the service, save global list inside one local variable, edit local variable and call the service with echo.

My questions are:

  1. How i can save the list in local variable? I know how to save string but not arrays.

  2. Any one know any better method to do this?

    Thanks for your help


Edit result from service

Posted: Fri Jan 17, 2014 11:19 am
by Maryna Brodina

Hello! [quote:]How i can save the list in local variable?[/quote]prelocalStorage.setItem("varName", JSON.stringify(data));/pre[quote:]Any one know any better method to do this[/quote]you can use server code or generic service, but it's more difficult to implement and requires some coding.


Edit result from service

Posted: Fri Jan 17, 2014 11:28 am
by Jordi Niubo

Thought I could not save directly

thank you very much Maryna