Hello Milton,
This should help http://docs.appery.io/documentation/b...
One more example http://docs.appery.io/tutorials/build...
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
Hello Milton,
This should help http://docs.appery.io/documentation/b...
One more example http://docs.appery.io/tutorials/build...
My JSON file is coming fron Google api so there is no linit parameter. It returns a file with 20 records every time. Is there a way to limit these to only the first 5 entries displaying in a grid?
You should change service incoming answer.
For this goals you should use service wrapper "Generic Security context".
Algorithm is:
1 service receive the response.
2 Generic security context get this response and change it(in your case you should to delete unnecessary items)
3 Return modified object.
Please read this document about it: http://docs.appery.io/documentation/g...
Igor,
I think I need to use Generic Security Context, but I am not understanding how to set it up from the document you provided. Can you help me with the JavaScript?
From the document, I don't understand what calls my GooglePlaces service or my GenericSecurityContext service.
My Service is called GooglePlaces, and it returns a JSON like this:
{
Code: Select all
"html_attributions" : [
],
"results" : [
{
"geometry" : {
"location" : {
"lat" : 33.885201,
"lng" : -118.410797
}
},
{
"geometry" : {
"location" : {
"lat" : 33.885158,
"lng" : -118.410012 }
}
Hi Milton,
Please do the following steps:
Create "Generic security context" and call it "MySecurityGeneric".
Open editor for JS implementation for this security context http://prntscr.com/33wngf/direct
Insert following JS code:
pre
Appery.MySecurityGeneric = Appery.createClass(SecurityContext, {
invoke: function(service, settings) {
var oldSuccess = settings.success;
Code: Select all
var onSuccess = function(value, other){
console.log("Original object");
console.log(value);
//here you should to change your object here. For example "value.length = 1;"
console.log("Changed object");
console.log(value);
oldSuccess.call(this, value, other);
};
settings.success = onSuccess;
Appery.MySecurityGeneric.$super.invoke.call(this, service, settings); }
});
/pre
Navigate to your service. And set this security context (MySecurityGeneric). http://prntscr.com/33wog4/direct
Test it. By Default you should have the same result as before it. But in console log you should get two object (before changes and after).
So you should implement your object changing logic (object after changes should be the same as object before changes, but with count of items you need).
That's all.
Illya, thanks for the help, but I still can not get it to work...
I was able to follow what you suggested, but when I test the service, I get no change even after changing the logic. I don't see the JSON in the console either. It doesn't seem like my service is running the security context. Any thoughts?
Milton.
You have missed this item:
[quote:]
Create "Generic security context" and call it "MySecurityGeneric".
[/quote]
See screen shot: http://prntscr.com/33wzvs/direct
Fix it and try again.
Illya, I made that change and also changed the service to call out "MySecurityGeneric" context now, but it still does not work. It is not running the Security Context code for some reason.
Any idea why?
Hi Milton,
Hard to say what is wrong. Please share your application with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a and tell us its name.