Take a list of items in a shopping cart as an example
List displays the Layer list component:
{xtype: ' DataView ', ID: ' Cart_view_list ', itemcls: ' Cart-view-list ', store: ' Cart ', Emptytext: ' No goods ', C LS: ' Dataview-basic ', Usecomponents:true, DefaultType: ' Cartviewgoods '}
Load another view page via DefaultType:
Ext.define (' XX.view.CartViewGoods ',{ extend: ' Ext.dataview.component.DataItem ', alias: ' Widget.cartviewgoods ', config:{ layout: ' Hbox ', items:[ { xtype: ' image ', itemId: ' cart_goods_view_img ', src: Config.website+ '/assets/img/nopic3.png ', height: 64, flex: 2, style: { ' background-size ': ' 64px ' } } , { xtype: ' component ', flex: 2, itemId: ' Cart_goods_view_name ', html: ' Product Name ', &NBSP;&NBSP;&Nbsp; padding: ' 5px 0 10px 0 ' },{ xtype: ' Spinnerfield ' , itemid: ' Cart_goods_view_spinner ', flex:3, minValue: 1, maxValue: 100, stepValue: 1, groupbuttons: false, padding: ' 13px 0 13px 0 ' },{ xtype: ' button ', flex: 1, text: ' Delete ', margin: ' 15px 0 0 0 ' } ] }, updaterecord: function (record) { Var me =this; &nBsp; if (Record.get (' directory ') && (Record.get (' logo ') != "" | | record.get (' logo ') != "NoMatch") { var img = config.upload+ "s/" +record.get (' directory ') + '/' +record.get (' logo '); me.down (' #cart_goods_view_img '). SETSRC (IMG); } me.down (' # Cart_goods_view_name '). Sethtml ((record.get (' name '). Length < 10 ? record.get (' name ') : record.get (' name '). substr (0,8) + "...") + "<br>¥" +record.get (' price '); me.down (' #cart_goods_view_spinner '). SetValue (Record.get (' qty ')); me.down (' #cart_goods_view_spinner '). Setmaxvalue (Record.get (' stock ')); this.callparent (arguments); });
Other controller and model omitted
Result diagram:
One problem has not been solved, Me.down is to take
Cartviewgoods
The first layer of the component, if it is to take the second layer of the component how to get it?
For example:
{ xtype: ' component ', flex: 2, itemid: ' cart_goods_view_name ', layout: ' VBox ', items: [ { xtype: ' component ', itemId: ' Cart_goods_view_name_title ', flex: 1 },{ xtype: ' component ', itemId: ' Cart_goods_view_name_content ', flex: 1 } ]}
Like the above, how to get
Cart_goods_view_name_title
Or:
Cart_goods_view_name_content
Elements?
Sencha Touch List contains components