0

当用户从下拉列表中选择一个选项时,显示的复选框将被新的复选框替换。

var chooser = '<select class="criteria" id="criteria">'
    '<option value="One">One</option>' +
    '<option value="Two">Two</option>' +
    '</select>';

var criteriaSelect = '<div id="my-chooser-dialog" title="Chooser"> +
        chooser + '</div>';

// criteriaChoices contains some checkboxes
if (jQuery("#my-chooser-dialog").dialog("isOpen") === true) {
    jQuery("#my-chooser-dialog" > tr").remove();
    jQuery("#my-chooser-dialog").append(criteriaChoices);
    jQuery("#my-chooser-dialog").show();
    return;
}

jQuery(criteriaSelect).dialog({modal: false, dialogClass: "my-chooser-dialog"});
jQuery("#my-chooser-dialog").append(criteriaChoices);
4

0 回答 0