开发者

How to target dialog buttons/Add ids

开发者 https://www.devze.com 2023-01-04 17:26 出处:网络
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 ther

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.

0

精彩评论

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