简体   繁体   English

如何在jQuery对话框标题栏上显示复选框?

[英]How to display the checkbox on the jquery dialog title bar?

Code: 码:

In Jquery dialog, 在“ jQuery”对话框中,

$('#status-dialog')
                .dialog({
                    hide: 'fade',
                    autoOpen: false,
                    resizable: true,
                    title: 'Status',
                    modal: false
                });

Index.cshtml Index.cshtml

<div class ="cb-status">
    <input id="accept-cb-name" type="checkbox"/>
    By Name<br /><br />
</div>

How to display the checkbox on the jquery dialog title("Status") bar? 如何在jquery对话框标题(“状态”)栏上显示复选框?

Check here DEMO http://jsfiddle.net/yeyene/GnpQ8/7/ 在这里检查演示http://jsfiddle.net/yeyene/GnpQ8/7/

$(document).ready(function(){
    $("#dialog-model").dialog({
        create: function (event, ui) {
            $(".ui-dialog-title").html('<input id="accept-cb-name" type="checkbox"/> By Name');
        },
        width: 250,
        height: 150,       
        modal: true,
        resizable: false
    });
    // checkbox event
    $(document).on('click','.ui-dialog-title input', function(){
        alert('Bang !!');
    });
}); 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM