EasyUI Forum

General Category => Bug Report => Topic started by: jtg on April 11, 2017, 03:20:32 AM



Title: [SOLVED] Bug with initially disabled combobox after calling combobox('enable')
Post by: jtg on April 11, 2017, 03:20:32 AM
Given there's disabled combobox

Code:
<select id="test" name="test" class="easyui-combobox" data-options="disabled:true">
    <option value="1">foo</option>
    <option value="2">bar</option>
</select>

which "compiles" to

Quote
<span class="textbox textbox-disabled combo" style="width: 40px; height: 20px;">
    <span class="textbox-addon textbox-addon-right" data-vivaldi-spatnav-clickable="1" style="right: 0px;">
        <a href="javascript:void(0)" class="textbox-icon combo-arrow textbox-icon-disabled" icon-index="0" tabindex="-1" style="width: 18px; height: 20px;"></a>
    </span>
    <input type="text" class="textbox-text validatebox-text" autocomplete="off" disabled="disabled" placeholder="" style="margin-left: 0px; margin-right: 23px; padding-top: 3px; padding-bottom: 3px; width: 14px;">
    <input type="hidden" class="textbox-value" name="test" disabled="disabled" value="1">
</span>

When you call $("#test").combobox("enable"), everything works as expected (textbox-disabled class removed, hidden value field enabled):

Quote
<span class="textbox combo" style="width: 40px; height: 20px;">
    <span class="textbox-addon textbox-addon-right" data-vivaldi-spatnav-clickable="1" style="right: 0px;">
        <a href="javascript:void(0)" class="textbox-icon combo-arrow" icon-index="0" tabindex="-1" style="width: 18px; height: 20px;"></a>
    </span>
    <input type="text" class="textbox-text validatebox-text" autocomplete="off" placeholder="" style="margin-left: 0px; margin-right: 23px; padding-top: 3px; padding-bottom: 3px; width: 14px;">
    <input type="hidden" class="textbox-value" name="test" value="1">
</span>

Now set combobox value with $("#test").combobox('setValue', 2). Hidden value field disabled again:

Quote
<span class="textbox combo" style="width: 40px; height: 20px;">
    <span class="textbox-addon textbox-addon-right" data-vivaldi-spatnav-clickable="1" style="right: 0px;">
        <a href="javascript:void(0)" class="textbox-icon combo-arrow" icon-index="0" tabindex="-1" style="width: 18px; height: 20px;"></a>
    </span>
    <input type="text" class="textbox-text validatebox-text" autocomplete="off" placeholder="" style="margin-left: 0px; margin-right: 23px; padding-top: 3px; padding-bottom: 3px; width: 14px;">
    <input type="hidden" class="textbox-value" name="test" disabled="disabled" value="2">
</span>

Now in order to submit form you have to show/hide panel - this enables hidden field.

Here's test case https://jsfiddle.net/jbastotp/
(Tested on 1.4.4 and 1.5.1)


Title: Re: Bug with initially disabled combobox after calling combobox('enable')
Post by: jarry on April 11, 2017, 07:29:09 AM
Please download the patch from http://www.jeasyui.com/download/downloads/jquery-easyui-1.5.1-patch.zip


Title: Re: Bug with initially disabled combobox after calling combobox('enable')
Post by: jtg on April 13, 2017, 02:03:43 AM
Thanks a lot :)