4.1.1에는 htmleditor 버그가있는 것 같습니다. 또한, ExtJS 객체를 만들기 위해 새로운 것을 사용해서는 안됩니다. 이로 인해 다른 ExtJS 문제가 발생합니다.
4.2.x로 업그레이드하면 htmleditor에서 문제가 해결됩니다.
코드의 형식을 잘 지정해야합니다. 또한 항목을 얻으려면 적절한 ExtJS 메서드를 사용해야합니다. 즉,
Ext.create('Ext.form.Panel', { // should be using Ext.create(), not new
title: 'HTML Editor',
width: 500,
bodyPadding: 10,
renderTo: Ext.getBody(),
items: [{
xtype: 'htmleditor',
name: 'editor',
enableColors: true,
enableAlignments: false,
enableLists: true,
enableSourceEdit: false,
anchor: '100%'
}],
dockedItems: [{
xtype: 'toolbar',
items: [{
xtype: 'button',
text: 'Get HTML',
handler: function(btn) {
// example of getting all form values
console.log(btn.up('form').getForm().getValues());
// proper example of getting by component
alert(btn.up('form').down('htmleditor').getValue());
}
}]
}]
});
'new'를 사용하는 것은 완벽하게 수용 할 수 있으며 심지어 성능을 위해 선호됩니다. 4.1부터, ExtJS 클래스는 모두 그 이유 때문에'Ext.create()'보다는 내부적으로'new'를 사용합니다. – hopper
구성 요소를 가져 와서 getCmp를 사용하는 Ext 메소드가 더 나쁘다 ... – sra
예. 실제로 .up(), .down(), .prev() 등을 사용해야합니다. – radtad