I have a modal dialog. I want one button to be disabled and then later enabled. I plan to do this by adding an id to the button and then using that id to use the add/remove attribute disabled. If there is another way I am open to suggestions. Here is some sample code:
$('#navDialog').d开发者_StackOverflowialog({
modal:true,
autoOpen:false,
height: 'auto',
width: 'auto',
title: "Category Editor",
buttons: {
"Delete": function(){somethingMore();},
"Edit": function(){something();},
"Confirm":function(){importantSomething();}
},
draggable: true,
resizable: false
});
I want to be able to control the Confirm button.
$('#navDialog').dialog({
modal:true,
autoOpen:false,
height: 'auto',
width: 'auto',
title: "Category Editor",
buttons: [{
id:"btn-delete",
text:"Delete",
click:function(){somethingMore();}
},{
id: "btn-edit",
text:"Edit",
click: function(){something();}
},{
id:"btn-confirm"
text:"Confirm",
click:function(){importantSomething();}
}],
draggable: true,
resizable: false
});
You can try this:
$('.ui-dialog-buttonpane button:contains(Ok)').hide();
There currently isn't any proper way of doing this. It's on the roadmap for inclusion but I don't exactly know when. I'll report back when I've found the forum post detailing this issue.
精彩评论