EasyUI Forum
September 13, 2025, 04:23:19 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Disable Dialog buttons  (Read 10997 times)
hunsin360
Newbie
*
Posts: 4


View Profile Email
« on: July 15, 2015, 03:17:26 PM »

I just tried out version 1.42 and something big changed with dialog toolbars and buttons.  For example, I used to be able to define a dialog button and give it an id:

...
buttons: [{
   text: 'My Button',
   id: 'mybutton'
}]

And then disable or enable it programmatically:

$('#mybutton').linkbutton('disable');

This no longer works.  Is there another way or is this no longer possible?
Logged
jarry
Administrator
Hero Member
*****
Posts: 2298


View Profile Email
« Reply #1 on: July 16, 2015, 01:20:16 AM »

To disable a linkbutton, you can call 'disable' method or set the 'disabled' to true.
Code:
<script type="text/javascript">
  $(function(){
    $('#dlg').dialog({
      buttons: [{
        id:'mybutton',
        text:'Ok',
        iconCls:'icon-ok',
        handler:function(){
          alert('ok');
        }
      },{
        text:'Cancel',
        disabled:true,
        handler:function(){
          alert('cancel');;
        }
      }]
    });
    $('#mybutton').linkbutton('disable');
  })
</script>
Logged
hunsin360
Newbie
*
Posts: 4


View Profile Email
« Reply #2 on: July 16, 2015, 08:15:04 AM »

From my code snippet you could see that I am calling the 'disable' method.

I have other link buttons that I can enable\disable with no problems.  The problem appears to only occur if I try to access either a dialog toolbar or regular button.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!