-1

我在弹出窗口上加载了一个视图,它工作正常,但没有设置窗口标题并且总是为空,但我在我的代码中设置它运行没有错误。我是怎么了?

$(function () {

$(".dialog-trigger").on("click", function (event) {
    event.preventDefault();
    $.ajax({
        url: "OpenSendSmsDialog",
        type: "GET",
    })
    .done(function (result) {
        $("#clientdetailmodal").html(result).dialog({
            autoOpen: true, width: 400, modal: true, show: {
                effect: "blind",
                duration: 1000
            }
        }, "option", "title", "321 file");
    });
});
});
4

3 回答 3

1

您在用于初始化对话框的对象之后传递随机参数,它们只是被忽略:http ://api.jqueryui.com/dialog/

    $("#clientdetailmodal").html(result).dialog({
        autoOpen: true,
        width: 400,
        modal: true,
        show: {
            effect: "blind",
            duration: 1000
        },
        title: '321 file'
    });
于 2013-07-31T09:49:11.550 回答
0

检查文档:

$( ".selector" ).dialog({ title: "Dialog Title" });

或者:

$( ".selector" ).dialog( "option", "title", "Dialog Title" );

所以在这里,你可以使用:

 $("#clientdetailmodal").html(result).dialog({
            autoOpen: true, width: 400, modal: true, show: {
                effect: "blind",
                duration: 1000

            },title: '321 file' 
        });
于 2013-07-31T09:48:33.240 回答
0

尝试像这样放置标题选项:

$("#dialog").dialog({
        autoOpen: true, width: 400, modal: true, show: {
            effect: "blind",
            duration: 1000
        }, title: "321 file" });
于 2013-07-31T09:50:05.297 回答