Page 1 of 1

disabling elements not working

Posted: Sat Sep 26, 2015 5:01 am
by Fernando

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.


disabling elements not working

Posted: Sat Sep 26, 2015 6:17 pm
by Alena Prykhodko

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


disabling elements not working

Posted: Sun Sep 27, 2015 5:31 pm
by Fernando

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.


disabling elements not working

Posted: Thu Oct 01, 2015 6:08 am
by Serhii Kulibaba

Hello Fernando,

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

instead of:

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


disabling elements not working

Posted: Sat Jan 23, 2016 12:27 am
by Kal

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?