2012-03-01 86 views
0

https://github.com/rbartholomay/ExtJS.ux.HtmlEditor.Plugins是用於htmleditor字段的ExtJS4兼容插件的組 。 在包含htmleditor字段的Netzke表單面板中使用這些插件的最佳方式是什麼?更多一般來說,我想知道如何在Netzke中使用ExtJS插件。在Netzke中使用Ext JS插件

下面是我的一些代碼:

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 

我想作出一些更改HTML編輯器的工具欄,但無法弄清楚如何在Netzke指定。請幫忙。

回答

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 

我認爲這是你在找什麼。

1

這取決於ExtJS4 API。你可以通過HTML編輯直接的任何配置屬性到你的項目散列配置類似

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

,因爲當你用「:的xtype」 netzke將創建ExtJS的組件與你喜歡configuration.It的不Netzke組件。 (如Netzke :: Basepack :: Panel不同於:xtype =>:面板)