Page 1 of 1

what is the Javascript under LocalStorage in REST mapping used for?

Posted: Sun Oct 06, 2013 1:15 am
by greg keys

what is the point of the javascript in the REST mapping area under the localStorage area on the right side, when you edit it, it shows function(value, element) I can see that if you map to it as if it were an element or localstorage variable the value represents the mapping but what is the element for?

Can I use this to dynamically map to various elements based on the response? ie say a type could be friend, group, document, etc.. can i use this javascript to determine which elements get mapped based on a response type?


what is the Javascript under LocalStorage in REST mapping used for?

Posted: Sun Oct 06, 2013 3:00 am
by Igor

Hello,

Please take a look at the next doc http://docs.appery.io/documentation/u...


what is the Javascript under LocalStorage in REST mapping used for?

Posted: Tue Oct 08, 2013 6:30 am
by greg keys

I dont see anything on that page which explains the purpose for the javascript below the localStorage variables, the documention you reference refers to the JS which can be attached to request, response and elements but not the section below localstorage


what is the Javascript under LocalStorage in REST mapping used for?

Posted: Tue Oct 08, 2013 10:04 am
by Maryna Brodina

Hello! While mapping to localStorage variable "element" function parameter is undefined. You can put any JS code, you'll get in value parameter corresponding part of response and implement any custom logic based on this data.