Page 1 of 1

Add information from Grid Listing or List to a Collection

Posted: Thu Oct 17, 2013 12:56 pm
by Deon

Hi

How do I add all the items from a List to a collection?

Thx


Add information from Grid Listing or List to a Collection

Posted: Thu Oct 17, 2013 1:53 pm
by Kateryna Grynko

Hi Deon,

You can add all the records to an array and send it:
codevar li = Appery("mobilelist_31").find("li");
var arr = new Array;
li.each(function(e){
arr.push(li[e]);
});/code
Or you can do this via mapping. You can see an example here, but you would need to map Response and Request vice versa: http://docs.appery.io/documentation/u...


Add information from Grid Listing or List to a Collection

Posted: Thu Oct 17, 2013 3:16 pm
by Deon

Hi Katya

For the mapping. I presume you would you use the Create Service? How do you map it Visa Versa and get all the items in using $? Do I create a custom service and swop response and request?


Add information from Grid Listing or List to a Collection

Posted: Thu Oct 17, 2013 6:17 pm
by Maryna Brodina

Sorry for misunderstanding. It can't be done with mapping and code posted above is just an example. It depends on your List or Grid structure. You need to go through List/Grid and retrieve all needed values to array and save that array to DB. Saving depends on your DB structure. If you need to save into one column with array type - you will need one DB request. If you need to save into several strings (each value into a separate string) then you need to call saving service as many times as you retrieve data (each time transmitting needed data as a request data - https://getsatisfaction.com/apperyio/...)