EasyUI Forum
November 07, 2025, 11:49:24 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [SOLVED] Enabe or disable button in tollbar???  (Read 11459 times)
MFS
Newbie
*
Posts: 47



View Profile
« on: December 30, 2015, 12:31:00 AM »

Hello again.


I want to disable button when is Status in some state for example in my case "arhiviran".
If I click on row that have this value I want to disable EDIT ( Izmjeni ) and DELETE ( ObriĊĦi ).

How to make that?
Thanks.
« Last Edit: December 31, 2015, 01:15:31 AM by MFS » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: December 30, 2015, 08:45:38 AM »

Set the 'id' property for the linkbutton, you will be able to select it and then enable or disable it.
Code:
$('#btn-edit').linkbutton('disable');
Logged
MFS
Newbie
*
Posts: 47



View Profile
« Reply #2 on: December 30, 2015, 11:54:15 PM »

This is my code:

Code:
<script type="text/javascript">
$(function()
{
$('#ZZOGrid').datagrid
(
{
rowStyler:function(index,row)
{
if (row.STATUS=='arhiviran')
{return 'background-color:Aquamarine ;font-weight:bold;';};
}
}
);
});
</script>


Make your suggestions where and how to put code for disable btnBrisanje ( Delete button ) when row.STATUS=='arhiviran' ??
« Last Edit: December 31, 2015, 12:47:09 AM by MFS » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: December 31, 2015, 01:01:02 AM »

You must detect what row is selected and then decide if to enable or disable the button.
Code:
$('#ZZOGrid').datagrid({
    rowStyler: function(){...},
    onSelect: function(index,row){
        if (row.STATUS == 'arhiviran'){
            $('#btnBrisanje').linkbutton('disable');
        } else {
            $('#btnBrisanje').linkbutton('enable');
        }
    }
})
Logged
MFS
Newbie
*
Posts: 47



View Profile
« Reply #4 on: December 31, 2015, 01:06:31 AM »

This code work.
Thanks.
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!