【发布时间】:2014-11-24 15:48:32
【问题描述】:
我正在创建一个 Sencha touch xtype,它将包含一个不可见的输入文件和一个按钮;我想在按下按钮时触发弹出窗口以选择文件。这是我到目前为止所做的:
config: {
baseCls: 'imageFileField',
layout: 'hbox',
items: [
{
xtype: 'label',
baseCls: Ext.baseCSSPrefix + 'form-label'
},
{
xtype: 'container',
layout: 'hbox',
flex: 1,
items: [
{
xtype: 'filefield',
hidden: true,
listeners: {
afterrender: function (cmp) {
cmp.fileInputEl.set({
accept: 'image/*'
});
}
}
},
{
xtype: 'label',
baseCls: Ext.baseCSSPrefix + 'form-label'
},
{
xtype: 'button',
margin: '5px',
docked: 'right',
ui: 'base_button',
iconCls: '',
width: '50px',
listeners: {
tap: function (view, e, eOpts) {
}
}
}
]
}
]
},
我知道我应该在 tap 方法中添加一些东西,以导航到项目然后触发事件。我尝试使用 this.up()/down(...) 但我一直无法获得不可见的输入。到达那里的正确“路径”是什么?
【问题讨论】:
标签: javascript extjs sencha-touch