There is the following can.Model:
var CaseModel = can.Model.extend({
findAll: function(args){
var def = $.Deferred();
args.sobject.retrieve(args.criteria, function(err, records) {//records should be populated into view
if(err) def.reject(err);
else def.resolve(records);
});
return def;
}}, {});
How should I implement the can.Control with init method to populate can.view with deffered=CaseModel.findAll({sobject: new SObjectModel.Case()}) like here:
this.element.html(can.view('recipes', Deffered));
and how these records are looped in mustache template: {{#each ???? }}
Thanks
Here is an example of how to do it with deferreds:
And here is a demo http://jsbin.com/kedih/1/edit
You should be able to adapt this to include your
args.sobject.retrieve
instead of thesetTimeout
in the example.