[英]Select2: Incorrect option selected by default
The issue location regarding question: https://xtee.radr.eu 有关问题的发布位置: https : //xtee.radr.eu
How to fix the second select box (Select Subsystem) that it wouldn't have the first option selected? 如何修复第二个选择框(“选择子系统”)没有选择的第一个选项? Currently it will select automatically:
xroad-center....
when opening the dropdown. 当前,它将在打开下拉列表时自动选择:
xroad-center....
It will also result that if I want to know information about the first option which is already selected xroad-center
, I have to select some other option first and then re-select the xroad-center
. 这也将导致如果我想了解有关已选择
xroad-center
的第一个选项的信息,则必须先选择其他选项,然后重新选择xroad-center
。
Additional question: How to reset the Select subsystem
select when different environment is selected? 附加问题:当选择了不同的环境时,如何重置
Select subsystem
选择?
Full source code is available here: https://github.com/tuudik/xroad6parser 完整的源代码可以在这里找到: https : //github.com/tuudik/xroad6parser
I found that after the first selection on the second box, the header option : 我发现在第二个框上进行第一个选择之后,标题选项为:
<option selected>- Select subsystem: -</option> disappears. <选择的选项>-选择子系统:-</选项>消失。
Do some test : remove it and see what happens. 做一些测试:将其删除,看看会发生什么。 If it solve the problem, try may be to instead include it in your second ajax function : subsystem_select(val)
如果它解决了问题,请尝试将其包含在第二个ajax函数中:subsystem_select(val)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.