Fernando
Posts: 0
Joined: Sat Mar 14, 2015 10:59 am

disabling elements not working

Hello.

I'm trying to disable elements when a checkbox is selected, but i only can disable a button at this time. Not select element or input element...

In the "value_change" event i have this javascript code

var checked = jQuery(this).find("input").prop("checked");

if(checked) {
//disabling input element - not work
Apperyio("myinput").attr("disabled", "disabled");

//disabling select menu list - not work
Apperyio("mylist").prop('disabled', false);
Apperyio("mylist").selectmenu("refresh");
$(".mylist").addClass("ui-disabled");
$('[dsid="mylist"]').addClass("ui-disabled");

Code: Select all

 //disabling buttion 
 $("[dsid='mybutton']").addClass('ui-disabled'); 

//Appery('mybutton').attr('disabled', 'disabled'); //not work
}

Thank you.
Regards.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

disabling elements not working

Hello!

To make component (input, textarea, button, list) visible, but disabled you should add ui-disabled class for component:

preAppery("componentName").addClass("ui-disabled");/pre

to enabled it - delete this class

preAppery("componentName").removeClass("ui-disabled");/pre

Fernando
Posts: 0
Joined: Sat Mar 14, 2015 10:59 am

disabling elements not working

Thanks!
I do it adding also
Appery("componentName").selectmenu("refresh");
to apply disable/enable

But i see that i can use select component. It is in gray color (text) but it still allow selecting an option...

How can i solve it?
Thank you again.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

disabling elements not working

Hello Fernando,

Please use JS:
Apperyio("componentName").parents('.ui-select').addClass('ui-disabled');

instead of:

Appery("componentName").selectmenu("refresh");

Kal
Posts: 0
Joined: Thu May 22, 2014 11:03 pm

disabling elements not working

Hi Sergiy,

This method does not work to disable a checkbox item. I have tried the following:

Apperyio("useCheckBox").find('input[type="checkbox"]').prop('disabled', true).addClass('ui-disabled');

Apperyio("useCheckBox").find('input[type="checkbox"]').parents('.ui-select').addClass('ui-disabled');

I have also tried the above without the ".find" operator.

None of the 4 methods work to disable the checkbox from being checked, or grey it out.

How do I do that?

Return to “Issues”