Title: Why select the combobox error when another combobox selected ?
Post by: ejzhang on May 09, 2015, 06:10:04 AM
I want select combobox named Bureau when the combobox named Station selected, but An error occurred, it is show in attachs. btw: There is double request when the dialog opened. it is show in attachs. <form id="frmRestriction" method="post" action="/restrictions/index.asp?m=Restriction&a=Append" onSubmit="return false;"> <input type="hidden" name="Id" value="" /> <div style="width:100%;padding:3px;text-align:left;margin-left:auto;margin-right:auto;"> <div style="float:left;margin:4px"> <nobr><label>路局</label> <select class="easyui-combobox" name="Bureau" style="width:128px"></select></nobr> </div> <div style="float:left;margin:4px"> <nobr><label>到站</label> <select class="easyui-combobox" name="Station" style="width:111px"></select></nobr> </div><div style="clear:both"></div> <div style="float:left;margin:4px"> <nobr><label>停装日期</label> <input class="easyui-datebox" name="StartDate" editable="false" style="width:88px" value="2015-05-09" /> <input type="checkbox" name="HasFinishDate" value="1" style="vertical-align:-2px" onclick="$('[name=FinishDate]').prop('disabled',!this.checked)" /><label>恢复日期</label> <input class="easyui-datebox" name="FinishDate" editable="false" style="width:88px" value="" /></nobr> </div><div style="clear:both"></div> <div style="float:left;margin:4px"> <nobr><label>备注</label> <input class="easyui-textbox" name="Notes" value="" data-options="multiline:true,prompt:'最多输入100个字'" style="width:277px;height:88px" /></nobr> </div> </div> </form> <script type="text/javascript"> <!-- $(function(){ $('[name=FinishDate]').datebox({ onSelect:function(){ $('[name=HasFinishDate]').prop('checked', true); } }); $('[name=Bureau]').combobox({ editable:false, valueField:'Id', textField:'Name', url:'/restrictions/index.asp?m=Restriction&a=Bureaus' }); $('[name=Station]').combobox({ valueField:'Id', textField:'Name', mode:'remote', url:'/restrictions/index.asp?m=Restriction&a=Stations', prompt:'请输入拼音码或电报码', delay:500, onSelect:function(record){ // $('[name=Bureau]').combobox('select', record.Bureau); } }); }); //--> </script>
Title: Re: Why select the combobox error when another combobox selected ?
Post by: stworthy on May 09, 2015, 08:54:22 AM
Please use the id selector to select your combobox components. <select class="easyui-combobox" id="Bureau" name="Bureau" style="width:128px"></select> <script> $('#Bureau').combobox('select',...); </script>
Title: Re: Why select the combobox error when another combobox selected ?
Post by: ejzhang on May 09, 2015, 03:37:40 PM
Why? Is it a bug?
Title: Re: Why select the combobox error when another combobox selected ?
Post by: stworthy on May 09, 2015, 05:40:30 PM
It is not a bug, if you really want to use the 'name' attribute selector, please try this: $('[comboName=Bureau]').combobox('select', record.Bureau);
Title: Re: Why select the combobox error when another combobox selected ?
Post by: ejzhang on May 10, 2015, 05:12:57 PM
Thanks a lot! :)
Title: Re: Why select the combobox error when another combobox selected ?
Post by: hjzhbb7758 on May 11, 2015, 07:45:38 PM
Thanks a lot! :)
未定义null .....options..... 什么的错误, 都是jquery 的选择器有问题。跟bug 无关
|