EasyUI Forum
March 28, 2024, 08:32:44 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [SOLVED] Bug with initially disabled combobox after calling combobox('enable')  (Read 8019 times)
jtg
Newbie
*
Posts: 3


View Profile
« 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)
« Last Edit: April 13, 2017, 02:04:03 AM by jtg » Logged
jarry
Administrator
Hero Member
*****
Posts: 2260


View Profile Email
« Reply #1 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
Logged
jtg
Newbie
*
Posts: 3


View Profile
« Reply #2 on: April 13, 2017, 02:03:43 AM »

Thanks a lot Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!