0

我对带有 sencha touch 的页面有以下要求:

  1. 一些选项的下拉列表
  2. 用户发布的问题(长度可能变化很大)
  3. 要显示的文本区域得到答案
  4. 提交和忽略两个按钮

我正在使用 vbox 布局。现在的问题是我希望页面完全可滚动,而不是在数据视图等上部分滚动。

我怎样才能实现它。我对不同的屏幕有类似的要求。

下面是代码:

Ext.define('HCMDoctor.view.PFQuestion', {
        extend : 'Ext.form.Panel',
        xtype : 'PFQuestion',
        id : 'pfView',
        config : {
            layout : {
                type : 'vbox',
                align : 'stretch'
            },
            flex : 1,
            scrollable : true,
            items : [{
                        xtype : 'container',
                        html : 'Public Forum Question' 
                    }, {
                        xtype : 'selectfield',
                        store : 'CommunityWiseQuestions',
                        name : 'pfCommId',
                        id : 'pfCommId',
                        valueField : 'communityId',
                        displayField : 'displayFull'
                    }, {
                        store : 'PFQuestion',
                        xtype : 'dataview',
                        flex : 1,
                        id : 'pfQuestionHolder',
                        itemTpl : ['{discussionTitle}<br>{description}',
                                '<br>Posted in {postedInCommunityName}']
                    }, {
                        xtype : 'hiddenfield',
                        id : 'pfQuestionId',
                        name : 'pfQuestionId'

                    }, {
                        xtype : 'textareafield',
                        id : 'pfAnswer',
                        name : 'pfAnswer'
                    }, {
                        store : 'PFQuestion',
                        xtype : 'button',
                        text : 'Ignore',
                        id : 'ignorePFQuestion'
                    }, {
                        store : 'PFQuestion',
                        xtype : 'button',
                        text : 'Submit',
                        id : 'submitPFQuestion'
                    }

            ]

        }
    });

谢谢

4

1 回答 1

0

onload 存储迭代记录,并在每次迭代中tpl通过将记录数据传递给它来创建面板并将面板添加到其父级。像这样的东西:

var parentPanel = Ext.getCmp("pfView");
for(var i=0; i++; i<records.size){
    var mypanel = Ext.create("Ext.Panel", {
        data    : records[i]
    });
    parentPanel.add(myPanel);
}
于 2013-06-25T08:57:26.727 回答