Lawnchair Phonegap Iteration Script

206 Views Asked by At

I am using Lawnchair for HTML5 iOS App Development for Persistant Storage.

I have an iteration script that returns undefined 11 times, here is the script

var lawnchair = Lawnchair({name:'relaxed', record:'config'}, function(people){

    this.all(function(record, index) { 
        records = record.length;
        couchURL = record.couchURL;
        alert(records);

        for(i = 0, len = records; i < len; i++){
            console.log(couchURL);
        }

    })
})

The Data is obviously in local storage but isn't being iterated out correctly, could anybody provide a fix for this? Thanks

1

There are 1 best solutions below

0
On

Try this :

var lawnchair = Lawnchair({name:'relaxed', adapter:'dom'}, function(people){

})

this.all(function(data) { 
    for(var i = 0; i<data.length;i++)
    {
       Get data using this...data[i].value.fieldname
    }

})