我有一个 jsfiddle 演示了该问题: http://jsfiddle.net/michaelajohnsonwa/sDchM/7/
隐藏时选择生成的下拉元素似乎未正确生成。我尝试过使用“选项”绑定和自定义 jqOptions 绑定。我尝试添加 .selectmenu('refresh') 到混合中,但结果没有区别。当在模板绑定中使用自定义绑定时,自定义绑定不起作用,我也对此感到好奇。
我不确定这是否是 jQuery selectmenu 或 knockout.js 的问题。
--edit: 刚刚发现工作代码在 IE 中不起作用。 Chrome 和 Firefox 确实准确地演示了这个问题。
如有任何帮助,我们将不胜感激!谢谢!!
I have a jsfiddle that demonstrates the problem at: http://jsfiddle.net/michaelajohnsonwa/sDchM/7/
The generated dropdown elements from the select when hidden don't seem to be generated correctly. I have tried using both the 'options' binding and the custom jqOptions binding. I tried added in .selectmenu('refresh') to the mix but there was no difference in the outcome. The custom binding doesn't work when used within a template binding which I also find curious.
I'm not sure if this is problem with jQuery selectmenu or knockout.js.
--edit: just discovered the working code doesn't work in IE. Chrome and Firefox do demonstrate the problem accurately.
Any help here will be appriciated! Thanks!!
发布评论
评论(1)
选择菜单插件在隐藏元素中将无法正常工作,因此应该这样调用。
编辑:
发生这种情况是因为隐藏元素的尺寸不正确。因此,可以通过给出选择元素的尺寸来解决这个问题。
请查看:http://jsfiddle.net/diode/sDchM/17/
Select Menu plugin will not work correctly in hidden elements, so it should be called like this.
EDIT:
It happens because of the incorrect dimensions of the hidden element. So this can be fixed by giving the dimension of the select element.
please see it : http://jsfiddle.net/diode/sDchM/17/