Sencha Touch List contains components

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.