Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

Add information from Grid Listing or List to a Collection

Hi

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

Thx

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

Add information from Grid Listing or List to a Collection

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...

Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

Add information from Grid Listing or List to a Collection

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?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Add information from Grid Listing or List to a Collection

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/...)

Return to “Issues”