sencha touch 2.0 : How to split a form across tab panels

爱⌒轻易说出口 提交于 2020-01-03 04:26:09

问题


I would like to split a form across several tab panels to avoid a (very) long form (forcing the user to scroll quite a lot to fill every field).

For the moment, I use fieldsets to group fields, but I would like to put the respective fields in separate tabs.

Is there a way to do that ?

Thanks


回答1:


Actually, it is simply possible to add a 'tabpanel' inside the 'formpanel', and the fields values will still be accessible (when using getValues() or submit())...

Simple enough ;)




回答2:


Yes, Create a tab panel and put each respective field(s) in its own tab

Ext.create('Ext.TabPanel', {
    fullscreen: true,
    tabBarPosition: 'bottom',

    defaults: {
        styleHtmlContent: true
    },

    items: [
        {
            title: 'Tab1',
           html: 'Tab 1',
            items:[{
                xtype:'textfield',
                fieldLabel:'Name'
            }]
        },
        {
            title: 'Tab2',
            html: 'Tab 2',

            items:[{
                xtype:'textfield',
                fieldLabel:'Date'
            }]
        }
    ]
});


来源:https://stackoverflow.com/questions/9767914/sencha-touch-2-0-how-to-split-a-form-across-tab-panels

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!