each

iterates through the collection of data items

void each(function method, [object master,boolean all] );
method
functiona method that needs calling for each data item master
objectan object that the method is applied to ("this" by default) all
booleanif true, hidden (as well as hidden by filtering) items are iterated

Example

template:function(data){
        var names = [];
        if (data.each)
            data.each(function(obj){  names.push(obj.name);});
        return names.join(", ");
}

Related samples

Details

The method function has two parameters:

template:function(data){
        var names = [];
        if (data.each)
            data.each(function(obj, index){ 
                names.push(obj.name);
                console.log(index + " is the index of the file")
             });
        return names.join(", ");
}
See also
  • Articles
  • Back to top
    Join Our Forum
    We've retired comments here. Visit our forum for faster technical support, connect with other developers, and share your feedback there.