煎茶触摸2 - 在数据视图

问题描述:

显示数据我新的ExtJS的,我已经,有医生名单的例子,但在医生详细页面,它看起来像一个人口稠密的形式,这是我的看法文件:煎茶触摸2 - 在数据视图

Ext.define("GS.view.DoctorView", { 
extend: "Ext.form.Panel", 
requires: "Ext.form.FieldSet", 
alias: "widget.doctorview", 
config:{ 
    scrollable:'vertical' 
}, 
initialize: function() { 

    this.callParent(arguments); 

    var backButton = { 
     xtype: "button", 
     ui: "back", 
     text: "Back List", 
     handler: this.onBackButtonTap, 
     scope: this 
    }; 

    var topToolbar = { 
     xtype: "toolbar", 
     docked: "top", 
     title: "Doctor Profile", 
     items: [ 
      backButton, 
      { xtype: "spacer" } 
     ] 
    }; 

    var bottomToolbar = { 
     xtype: "toolbar", 
     docked: "bottom", 
     items: [ 

     ] 
    }; 

    var doctorNameView = { 
     xtype: 'textfield', 
     name: 'title', 
     label: 'Title', 
     required: true 
    }; 

    var doctorDescView = { 
     xtype: 'textareafield', 
     name: 'narrative', 
     label: 'Narrative' 
    }; 

    this.add([ 
     topToolbar, 
     { xtype: "fieldset", 
      items: [doctorNameView, doctorDescView] 
     }, 
     bottomToolbar 
    ]); 
}, 
onBackButtonTap: function() { 
    this.fireEvent("backToListCommand", this); 
} 
}); 

我会采取哪些步骤将其转换为dataview,或者如何使用我的自定义HTML?

首先,您的问题非常模糊,所以您应该通过一些dataview教程或文章来理解您为什么真的需要数据视图,因为列表是数据视图,表单就是您创建的细节视图。

http://www.sencha.com/blog/dive-into-dataview-with-sencha-touch-2-beta-2

http://docs.sencha.com/touch/2-1/#!/guide/dataview

要使用自定义HTML,你必须使用xtemplate

http://docs.sencha.com/touch/2-1/#!/api/Ext.XTemplate