【问题标题】:Sencha Architect - creating a screen with a formSencha Architect - 使用表单创建屏幕
【发布时间】:2012-07-12 04:49:00
【问题描述】:

刚开始看煎茶触摸

谁能解释一下你会在哪里使用“FieldSet、FormPanel 和容器”

例如:带有标题、文本字段和提交按钮的表单?

登录屏幕 ...

Title: Login
TextField: username
PasswordField: password
Button: submit  

1) 此登录屏幕是否会位于容器、字段集和/或表单面板中?

2) 没有标题的表格怎么办?只是文本字段、按钮,还是只是带有标题、数据列表的屏幕?

【问题讨论】:

    标签: javascript sencha-touch extjs sencha-touch-2 sencha-architect


    【解决方案1】:

    我认为示例代码会对您有所帮助:

    Ext.define('MyApp.view.LoginSiteContainer', {
    extend: 'Ext.form.Panel',
    alias: 'widget.loginsitecontainer',
    
    config: {
        id: 'loginform',
        url: 'som_url',
        items: [            
            {
                xtype: 'container',
                layout: {
                    type: 'vbox'
                },
                items: [
                    {
                        xtype: 'fieldset',
                        instructions: 'Login using existing account. Password is case sensitive.',
                        title: 'Login details',
                        items: [
                            {
                                xtype: 'textfield',
                                id: 'login',
                                itemId: 'login',
                                label: 'Login'
                            },
                            {
                                xtype: 'passwordfield',
                                id: 'password',
                                itemId: 'password',
                                label: 'Password'
                            }
                        ]
                    },
                    {
                        xtype: 'panel',
                        layout: {
                            type: 'hbox'
                        },
                        items: [
                            {
                                xtype: 'button',
                                id: 'Login',
                                itemId: 'Login',
                                margin: '0.1em',
                                ui: 'confirm',
                                text: 'Login',
                                flex: 1
                            }
                        ]
                    }
                ]
            }
        ],
        listeners: [            
            {
                fn: 'onLoginTap',
                event: 'tap',
                delegate: '#Login'
            }
        ]
    },
    
    
    onLoginTap: function(button, e, options) {
    // login function here
    }
    

    });

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多