This is a migrated thread and some comments may be shown as answers.

Disabled attribute don't work with chrome/mozilla

3 Answers 122 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Helmi
Top achievements
Rank 1
Helmi asked on 03 May 2012, 04:02 PM
Hello every One,
i'm  using telerik mvc.I create a custom command button .
 columns.Command(commands =>
                        {
                            commands.Edit();
                            commands.Custom("ValidApproved")
                                        .Text("Approve Customer")
                                       // .Action("ApprovedCustomer", "CustomerGrid")
                                        .DataRouteValues(route => route.Add(o => o.DunsCustomerId).RouteKey("id"))
                                        .HtmlAttributes(new Dictionary<string, object> { { "class", "button-state" } });

 
                        });
After that i create the javascript function
 function customer_OnRowDataBound(e) {
        var grid = $(this).data('tGrid');
        EnableApproved(e);
    }
 function EnableApproved(e) {
        var d = e.dataItem;
        if (d != null) {
            if (d["CustomerStatus"] == 1) {
                $(e.row).find('a.button-state').attr('disabled', 'true');
            }
        }
    }
The problem is that disabled attribute is not supported by chrome and mozilla even when i replace attr with prop or true with disabled and it work with IE
Can you help me please.
Best regards,
Helmi 

3 Answers, 1 is accepted

Sort by
0
Pechka
Top achievements
Rank 1
answered on 04 May 2012, 07:40 AM
Hi,

try to use .removeAttr('disabled')
0
Helmi
Top achievements
Rank 1
answered on 04 May 2012, 08:35 AM
Good morning everyone;
@Pechka:Thank you for your response,but i still have the same problem with the function removeAttr 

function EnableApproved(e) { 
        var d = e.dataItem;
        if (d != null) {
            if (d["CustomerStatus"] == 1) {
                $(e.row).find('a.button-state').removeAttr('disabled');
          }
        }
    }
It does'nt work even with IE!!when i use the développer tools of IE,i can see
<a class="t-button button-state t-grid-ValidApproved" href="/CustomerGrid/CustomerFirstLook/22222?CustomerGrid-page=1&CustomerGrid-orderBy=&CustomerGrid-filter=CustomerStatus~eq~true">
You can see the difference in the attached files.
Thank you in advance.
Helmi
0
Arash
Top achievements
Rank 1
answered on 07 Nov 2012, 09:13 AM
Hi,

you can add t-state-disabled class to your button.
Tags
Grid
Asked by
Helmi
Top achievements
Rank 1
Answers by
Pechka
Top achievements
Rank 1
Helmi
Top achievements
Rank 1
Arash
Top achievements
Rank 1
Share this question
or