How to learn kendo dropdownlist is enabled or disabled in javascript?

11k views Asked by At

I want to learn kendo dropdownlist is enabled or disabled for using in a if function.

For example if kendo dropdownlist is enabled my return value true, otherwise false

How can I do that?

Thanks for all answers

4

There are 4 answers

2
BENARD Patrick On BEST ANSWER

You can do very simply with

$('#selectId').prop('disabled');

In disabling, KendoUI disabled too the select, so :

var state = $('#selectId').prop('disabled');
0
cretzzzu3000 On

Just do this:

$("#your_dropdown_id").attr("aria-disabled");

If it is disabled this returns true else it returns false.

1
Jimesh On

BENARD Patrick's answer is correct.

Below also worked for me(alternative solution):

<script>
  $("#selectionKendoList").kendoDropDownList({
    enable: false
  });
  
  if($("#selectionKendoList").parent().find(".k-dropdown-wrap").hasClass("k-state-disabled")) {
    alert("Disabled");
  }
  else {
    alert("Enabled");
  }
</script>
0
AGuyCalledGerald On

This should work:

$('#your_dropdown_id').data("kendoDropDownList").options.enabled;