如何设置dijit.form.Select的宽度? [英] How do I set the width of dijit.form.Select?

查看:113
本文介绍了如何设置dijit.form.Select的宽度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个以编程方式生成的dijit.form.Select。与大多数其他小部件不同,选择不提供调整大小的方法,如

  dijit.resize({w:width,h:height }); 

我没有找到设置选择宽度的标准化方式。这是非常糟糕的,因为自动调整使Dialogs在长选择值上爆炸。



有没有一种标准的方式来调整我错过的选择?或者我有混乱的选择硬盘的标记?



谢谢!

解决方案

为什么你不会这样设置小部件的样式?



http://jsfiddle.net/QEjYD/1/



不幸的是,由于小部件的写作,如果您连接CSS类中的宽度,或者在创建该窗口小部件后设置宽度样式,则此不起作用。


I have a programmatically generated dijit.form.Select. Unlike most other widgets, the Selects do not offer a resize method like

dijit.resize({w: width, h: height});

I have not found a standardized way of setting the width of a select. This is quite bad because the autosizing makes Dialogs "explode" on long select values.

Is there a standard way to resize a select I have missed? Or do I have mess with the markup of the select the hard way?

Thanks!

解决方案

Why wouldn't you simply do this by setting the widget's style?

http://jsfiddle.net/QEjYD/1/

Unfortunately, due to how the widget is written, this doesn't work if you hook up the width in a CSS class, or if you set the width style after the widget has been created.

这篇关于如何设置dijit.form.Select的宽度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆