Note that there are some explanatory texts on larger screens.

plurals
  1. PODrop Down List doesn't locked
    text
    copied!<p>I have a div with drop down list. I tried to disable all div. I succeeded but I can't disable the dropdown list. This div is consist of select tag called cb3. I working with Knock Out.(All the data binding you see). the condition value: hete.selectedvalue,enable:format.selectedvalue()!='xxx' destroy the disable I would like to make.</p> <pre><code>&lt;div class="DivStyle1" data-bind="disableByRole: hetel.readOnlyValue"&gt; &lt;div id="div-for-cb3" class="div-for-combo poscombo3""&gt; &lt;select id="cb3" onchange="onSelectChange(this.id, this.options[this.selectedIndex].innerHTML)" dir="rtl" class="SelectStyle3" data-bind="options: hete.defaultValue,value: hete.selectedvalue,enable:format.selectedvalue()!='xxx' "&gt;&lt;option value="x1"&gt;x1&lt;/option&gt;&lt;option value="x2"&gt;x2&lt;/option&gt;&lt;option value="x3"&gt;x3&lt;/option&gt;&lt;option value="x4"&gt;x4&lt;/option&gt;&lt;/select&gt; &lt;span id="label-for-cb3" class="label-for-combo" data-bind="text:hete.selectedvalue""&gt;x4&lt;/span&gt; &lt;/div&gt; &lt;span class="SpanStyle3"&gt;:hete&lt;/span&gt; &lt;img id="hetelIMG" onclick="ChangeImg('hete','#heteIMG')" data-bind="attr:{src: myview.hete.readOnlyUrl}" class="ImgStyle3" " src="./idle.png"&gt; &lt;/div&gt; </code></pre> <p>in other js file:</p> <pre><code>ko.bindingHandlers.disableByRole = { update: function(element, valueAccessor, allBindingsAccessor) { var value = valueAccessor(); var allBindings = allBindingsAccessor(); var valueUnwrapped = ko.utils.unwrapObservable(value); var isDisabled = valueUnwrapped == 'true' if (isDisabled) $(element).find('*').attr('disabled', 'disabled') .prop('onclick', false) .css('opacity',0.7); } }; </code></pre> <p>Only the select tag isn't disabled... why? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload