开发者

Setting Jquery diloag button text does not work as expected

I am trying to use jquery dialo开发者_JAVA百科g, but the following code shows 0, 1 on the button text instead of the text that is specified. I need to use this syntax compared to the other one mentioned in jQuery docs. Can any one help me with the flowing code.

$( ".selector" ).dialog({ buttons: [
    {
        text: "Ok",
        click: function() { $(this).dialog("close"); }
    }
] });


It works in a fiddle exactly as you have it:

http://jsfiddle.net/jensbits/bGuLj/

Maybe something else is conflicting??

You have options in your code that do not exist for the jquery dialog: autoShow and beforeClose

You probably want to use autoOpen: false

See updated fiddle:

http://jsfiddle.net/jensbits/bGuLj/5/


Try,

$(DialogDiv).dialog({ 
  bgiframe: true, 
  resizable: false, 
  buttons: { 
    { "Save": function() { saveCallback();} }, 
    { "Cancel": function() { cancelCallback(); } 
  }
});

JQueryUI expects an object for buttons but, you are passing array.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜