Extjs 无法在sencha touch 2.2表单面板上获取html文本框值
我正在使用sencha touch 2.2。 我正在Ext.form.Panel上设置Sencha Touch中的html,如下所示Extjs 无法在sencha touch 2.2表单面板上获取html文本框值,extjs,sencha-touch,Extjs,Sencha Touch,我正在使用sencha touch 2.2。 我正在Ext.form.Panel上设置Sencha Touch中的html,如下所示 Ext.define('MyApp.view.MyFormView', { extend: 'Ext.form.Panel', xtype: 'MyFormView', config: { items:[ { xtype: 'fieldset', title: 'Add Form Details', items:[ . . . { html: [ '<di
Ext.define('MyApp.view.MyFormView', {
extend: 'Ext.form.Panel',
xtype: 'MyFormView',
config: {
items:[
{
xtype: 'fieldset',
title: 'Add Form Details',
items:[
.
.
.
{
html: [
'<div class="formula-div"><input id="textbox1" type="text" class="text-box-width"/> / <input id="textbox2" type="text" class="text-box-width"/></div>'
].join("")
},
.
.
.
]
}
]
}
});
我想获取html文本框的值。
我试过这个
document.getElementById('textbox1').value
但它不会返回任何值
当我用add按钮移除面板并直接调用form时,我得到了这个值。正如Kevhender所建议的,最好使用
Ext.field.TextArea
或Ext.field.Text
在项目中创建文本框。从那时起,您就更容易获得文本框的值,就像Ext.getCmp(“文本框的ID”).getValue()
以下是一些有用的链接:
您使用
html
config来绘制这样的文本区域有什么原因吗?您最好使用Ext.field.TextArea
组件。文件如下:
controller.getNavView().push(myForm);