require(['dojo/when']);var json = new JsonRest({target: url}); store = new ObjectStore({objectStore: json}); store.onFetch = function(results){ // 方法一: results.then(function(rs){ console.log('rs len-',rs.length); }); // 方法二:
require(['dojo/when']); var json = new JsonRest({target: url}); store = new ObjectStore({objectStore: json}); store.onFetch = function(results){ // 方法一: results.then(function(rs){ console.log('rs len->',rs.length); }); // 方法二: when(results, function(results){ console.log('when->',results.length); console.dir(results); }); };