日期:2014-05-16 浏览次数:20426 次
Ext.define('Sample.Musician', { extend: 'Sample.Person', mixins: { guitar: 'Sample.ability.CanPlayGuitar', compose: 'Sample.ability.CanComposeSongs', sing: 'Sample.ability.CanSing' } });
// GET /users/123 User.load(123, { success: function(user) { console.log(user.get('name')); //"Aaron Conran" console.log(user.orders().getCount()); //"1" -- there is only 1 order in the response above //we can iterate over the orders easily using the Associations API user.orders().each(function(order) { console.log(order.get('status')); //"shipped" //we can even iterate over each Order's OrderItems: order.orderItems().each(function(orderItem) { console.log(orderItem.get('title')); //"Sencha Touch" }); }); } });