0

https://github.com/rbartholomay/ExtJS.ux.HtmlEditor.Plugins是一组用于 htmleditor 字段的 ExtJS4 兼容插件。在包含 htmleditor 字段的 Netzke 表单面板中使用这些插件的最佳方式是什么?更一般地说,我想知道如何在 Netzke 中使用 ExtJS 插件。

这是我的一些代码:

class DocumentForm < Netzke::Basepack::FormPanel

config do
  { 
    :title => "Edit Document",
     :items => model_fields
  }
end

def model_fields
  [{
    :xtype => 'textfield',
    :field_label => 'Title',
    :name => 'title',
    :allowBlank => false,
    :read_only => false
  },
  {
    xtype: 'htmleditor',
    name: 'body',
    field_label: 'Bodytext',
    height: 300,
    anchor: '98%',
    read_only: false,
  }]
end

我想对 htmleditor 的工具栏进行一些更改,但不知道如何在 Netzke 中指定它。请帮忙。

4

2 回答 2

1

它依赖于 ExtJS4 API。您可以将 htmleditor 的任何配置属性直接传递给您的项目哈希配置,例如

{
  :xtype => :htmleditor,
  :some_config => "some_value"
}

因为当你使用 ":xtype" 时,netzke 会用你喜欢的配置创建 ExtJS 组件。它不是 Netzke 组件。(像 Netzke::Basepack::Panel 不同于 :xtype => :panel)

于 2012-04-10T05:33:22.287 回答
0

你“做一些改变”是什么意思?我认为您想从 htmleditor 中删除一些基本人员,例如字体,超链接,是吗?这很简单:

    xtype => 'htmleditor',
    name => 'body',
    field_label: 'Bodytext',
    height => 300,
    anchor => '98%',
    read_only => false,
    enableColors => false,
    enableAlignments => false,
    enableFont => false,
    enableFontSize => false,
    enableFormat => false,
    enableLists => false

我想这就是你要找的。

于 2012-03-26T18:10:18.847 回答