它没有显示任何错误,也没有渲染任何UI。我想动态添加数字字段。我对ext js非常陌生,有人可以告诉我的代码有什么问题
var numberField= Ext.create('Ext.form.Panel', {
cls: 'questionRows',
hidden: show,
itemId: item.HealthNeedsDetailsGuid,
id: item.HealthNeedsDetailsGuid,
items: [{
xtype: 'field',
html: item_index + ') ' + item.HealthNeedsQuestion
}, {
xtype: 'numberfield',
anchor: '100%',
name: 'bottles',
clearIcon: false,
width: 400,
value: 99,
maxValue: 99,
minValue: 0
}]
});
隐藏:节目,如果“秀”是一个变量,然后它必须是“假”。你不应该使用id,而只能使用itemIds。与xtype'领域'的项目是没有必要的,因为你可以使用数字字段上的标签(可能与labelAlign:'顶部') – Dinkheller