jQWidgets Forums
jQuery UI Widgets › Forums › Lists › ComboBox › combobox disabled function's problem.
Tagged: combobox, combobox control, disabled, jqwidgets combobox
This topic contains 3 replies, has 3 voices, and was last updated by cosostones 11 years, 5 months ago.
-
Author
-
Hi Jqwidgets team.
I found a combobox’s problem.
I have 3 comboboxs. when I set disabled to all combobox. Dropdown button is disabled but It still be able to input text in combobox text.
Just the third combobox that is disabled completely. In case set Enabled is same.Here is my simple code. Thank you.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <title></title> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../../scripts/gettheme.js"></script> <script type="text/javascript" src="../../scripts/jquery-1.8.3.min.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcombobox.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcheckbox.js"></script></head><body> <div id='content'> <script type="text/javascript"> $(document).ready(function () { var theme = getDemoTheme(); var source = [ "Affogato", "Americano", "Bicerin", "Breve", "Café Bombón", "Café au lait" ]; // Create a jqxComboBox $("#jqxComboBox").jqxComboBox({ selectedIndex: 0, source: source, width: '200px', height: '25px', theme: theme }); $("#jqxComboBox2").jqxComboBox({ selectedIndex: 1, source: source, width: '200px', height: '25px', theme: theme }); $("#jqxComboBox3").jqxComboBox({ selectedIndex: 2, source: source, width: '200px', height: '25px', theme: theme }); $('#Enabled').jqxCheckBox({ checked: true, width: '50px', theme: theme }); $('#Enabled2').jqxCheckBox({ checked: true, width: '50px', theme: theme }); $('#Enabled3').jqxCheckBox({ checked: true, width: '50px', theme: theme }); $('#Enabled').on('change', function (event) { var checked = !event.args.checked; $("#jqxComboBox").jqxComboBox({ disabled: checked }); }); $('#Enabled2').on('change', function (event) { var checked = !event.args.checked; $("#jqxComboBox2").jqxComboBox({ disabled: checked }); }); $('#Enabled3').on('change', function (event) { var checked = !event.args.checked; $("#jqxComboBox3").jqxComboBox({ disabled: checked }); }); }); </script> <div id='jqxComboBox'></div><div id='Enabled'>Enabled ComboBox 1</div><br/> <div id='jqxComboBox2'></div><div id='Enabled2'>Enabled ComboBox 2</div><br/> <div id='jqxComboBox3'></div><div id='Enabled3'>Enabled ComboBox 3</div> </div></body></html>
Hi,
You can use the following workaround:
$('#Enabled').on('change', function (event) { var checked = !event.args.checked; $("#jqxComboBox").jqxComboBox({ disabled: checked }); $("#jqxComboBox input").attr('disabled', true); }); $('#Enabled2').on('change', function (event) { var checked = !event.args.checked; $("#jqxComboBox2").jqxComboBox({ disabled: checked }); $("#jqxComboBox2 input").attr('disabled', true); }); $('#Enabled3').on('change', function (event) { var checked = !event.args.checked; $("#jqxComboBox3").jqxComboBox({ disabled: checked }); $("#jqxComboBox3 input").attr('disabled', true); });
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Thank you ^_^
Hi,
I had the same problem ‘Sacrifice’ had.
The workaround is working fine for now. Thanks.
But for the future, it could be a problem if combobox structure change.
(potential bug in our application in the future)So, do you know if this will be fixed in some release ?
Regards.
Alain.
-
AuthorPosts
You must be logged in to reply to this topic.