Thanks!
Thanks!
Hi Laura,
Your referred to a good guide http://docs.appery.io/tutorials/build... If you follow steps in it you will create needed application.
Try to do the following.
Laura,
You posted one more URL above. Probably you want to delete it.
Hi Katya:
It is possible if I have this service, that appears in the list only once, valencia, ontinyent, madrid instead of repeated.
This is my public link:
Hi Laura -
The best way to solve your problem is to return only unique values from the server. But if you can't change its behavior you can use our server code, in which you can return only unique values to your app from.
http://docs.appery.io/documentation/b...
Hi Illya:
Ok I can use server code, but I'm a little lost, can you guide me a little more?
I have seen the manual, but what do I need one script library?
Or just following the manual, I get what I want?
thanks
laura
Hi Laura,
If you read XML data and there is no possibility to filter the needed values, you can use custom server code implementation. You can also filter the data within Appery.io, right after you receive it.
Hi Katya:
Thanks for the information but you could detail how to do it.
I'm lost.
How to filter data
Hi Laura,
For example,you get all the data from server. Save it in localStorage: on service Success event save full server response in a variable 'data'. You can filter the elements using codejQuery.unique()/code:
https://api.jquery.com/jQuery.unique/
Then invoke Generic service that returns a needed result:
http://docs.appery.io/documentation/u...
And finally add mapping for this Generic service.
Sorry Katya but I do not, we can go step by step?
First, I called the service and have kept populations in localStorage.
Now, in succes event:
But don't working:
var arr = localStorage.getItem('poblacion');
$.each(unique(arr), function(i, value){
$('list').eq(1).append(value + ' ');
});
function unique(array){
return array.filter(function(el,index,arr){
return index == arr.indexOf(el);
});
}
And this function but if I didn't connect with list and label:
Code: Select all
$('.list').each( function(){
var myArr = [localStorage.getItem('poblacion')];
myArr = $.unique(myArr);
var val = "";
for (var i = 0; i < myArr.length; i++) {
val += myArr[i] + ",";
}
val = val.slice(0, -1);
alert(val);
}); Thanks for your help.
This is very difficult for me.