How to add multiple buttons in Jquery UI dialog box?

后端 未结 2 864
北海茫月
北海茫月 2021-02-05 22:46

I would like to have more than one button. I tried to copy code between brackets but doesnt work.Ideas?

buttons: {

\"Close\": function() {
 $(this).dialog(\"clo         


        
2条回答
  •  渐次进展
    2021-02-05 23:03

    Create them using this format, 'button text': function() { } with a comma inbetween, like this:

    $("#mydialog").dialog({
      buttons: {
        'Confirm': function() {
           //do something
           $(this).dialog('close');
        },
        'Cancel': function() {
           $(this).dialog('close');
        }
      }
    });
    

提交回复
热议问题