1

我有一个可移动的 DOJO 编辑器

<div id="dnd" dojoType="dojo.dnd.Moveable">
        <div data-dojo-type="dijit/Editor" height="120px" width="250px"
            id="editor3"
            data-dojo-props="plugins:['bold','italic']">
            <p>This instance is created with customized toolbar/ plugins</p>
        </div>
    </div>

我想知道:
1-为什么更改宽度属性不会对编辑器的宽度产生任何
影响 2-为什么编辑器仅在第一次拖动时才调整自身大小(到适当的高度)

我使用 DOJO 1.9.1

4

1 回答 1

1

在 div 上使用 style 属性,而不是 height 和 width,dojo 会尊重这一点。

<div id="editor3"
    data-dojo-type="dijit/Editor" style="width:250px;"
    data-dojo-props="plugins:['bold','italic'], height: '120px'">
        <p>This instance is created with customized toolbar/ plugins</p>
</div>

高度将自动确定(尽可能小并根据需要扩展),但如果您需要高度控制,您可以在 data-dojo-props 中指定 minHeight 属性和 height 属性(如上所示)

于 2013-07-11T01:36:34.780 回答