【发布时间】:2013-12-19 01:25:31
【问题描述】:
我有一个带有典型设置的手风琴面板。在每个面板中曾经有一个 textarea 并且一切正常。
现在我用htmleditor 替换了每个textarea。当我折叠面板并重新展开它时,htmleditor 的内容丢失了。当我使用textarea 时,这并没有发生。如何解决这个问题?
已编辑:另外,当重新展开时,htmleditor 冻结,我无法输入任何内容。但是按钮可以工作(粗体、插入链接、切换到源编辑等)。更奇怪的是,当我切换“切换到源”按钮两次时,内容会以不同的字体重新出现!
使用Accordion:
myDataStore.load({params: ...}, callback: onLoadSuccess);
......
onLoadSuccess: function() {
// for each data item, create a new panel and add it to myListPanel
for (var i = 0; i < myDataStore.getTotalCount(); i++) {
var dataItem = myDataStore.getAt(i);
var newFormPanel = new Ext.FormPanel({
labelAlign: 'top',
items : [{
xtype: 'htmleditor',
fieldLabel: 'Content',
autoScroll: true,
enableFont: false,
enableLists: false,
value: dataItem.get('content');
}],
buttons: [{...}]
});
// add this panel to the accordion
myListPanel.add({
title: 'Another panel',
items: [newFormPanel]
});
}
myListPanel.doLayout();
}
当前Accordion 配置:
var myListPanel = new Ext.Panel({
autoHeight : true,
autoWidth: true,
autoScroll : true,
layout : 'accordion',
layoutConfig : {
titleCollapse: true,
animate: true,
fill : false,
autoWidth: true,
hideCollapseTool: true,
},
});
【问题讨论】:
-
你能发布你的完整工作代码吗?
-
完整代码会太长...我更新了
Accordion的用法:新面板从数据存储添加到手风琴面板。 -
更新:我将
animate转为false,问题解决了! @_@
标签: javascript extjs