如何在模态对话框中创建编辑器窗口小部件?

时间:2012-02-29 06:07:15

标签: wijmo

我想在模态对话框中创建Edit小部件的实例。 Dialog可以与textarea控件一起使用,但是一旦我附加了编辑器,编辑器就不会显示属性。

HTML

<div id="servicio-dialog" title="Servicio">
    <form id="servicio-dialog-form">
        <ul class="mm-simple">
            <li><label for="servicio-dialog-name">Categoria</label></li>
            <li><input type="text" id="servicio-dialog-name" value=""/></li>

            <li><label for="servicio-dialog-description">Descripcion</label></li>
            <li><textarea id="servicio-dialog-description"></textarea></li>
        </ul>
    </form>
</div>

的JavaScript

$("#servicio-dialog").wijdialog({
    autoOpen: false,
    modal: true,
    resizable: false,
    width: 600,
    height: 480,
    buttons: [
        { text: 'Acceptar', click : mm_onDialogAcceptar},
        { text: 'Cancelar', click: mm_onDialogCancelar}
    ],
    captionButtons: {
        pin: { visible: false },
        refresh: { visible: false },
        toggle: { visible: false },
        minimize: { visible: false },
        maximize: { visible: false }
    }
});

$('#servicio-dialog-description').wijeditor({
    mode: 'simple'
});

1 个答案:

答案 0 :(得分:0)

最简单的方法是在对话框打开后初始化它:

$("#servicio-dialog").wijdialog({
    autoOpen: false,
    modal: true,
    resizable: false,
    width: 600,
    height: 480,
    buttons: [
        { text: 'Acceptar', click : mm_onDialogAcceptar},
        { text: 'Cancelar', click: mm_onDialogCancelar}
    ],
    captionButtons: {
        pin: { visible: false },
        refresh: { visible: false },
        toggle: { visible: false },
        minimize: { visible: false },
        maximize: { visible: false }
    },
    open:function(){
        $('#servicio-dialog-description').wijeditor({
            mode: 'simple'
        });
    }
});