ExtJS FormPanel动态添加字段后更改labelWidth
我有一个动态 FormPanel,在加载所有字段后需要设置标签宽度。我在调用 this.doLayout 之前尝试使用 this.labelWidth = 200 但它忽略了新值。
有人可以告诉我在哪里可以设置它并重新绘制表格,谢谢。
I have a dynamic FormPanel where I need to set the label width after I have loaded in all the fields. I have tried using this.labelWidth = 200 before calling this.doLayout but it's ignoring the new value.
Can someone tell me where I can set this and redraw the form, thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在查看 FormLayout 的 extjs 源代码后,我发现在调用表单上的 doLayout 之前可以设置一些变量来更改标签宽度。
因此,在 FormPanel 中使用以下代码来更改标签宽度:
After looking through the extjs source code for FormLayout I found that some variables you can set to change the label width before calling doLayout on the form.
so inside your FormPanel use the following code to change the label width:
FormPanel 渲染后是否不再考虑
labelWidth
配置选项?也许您可以使用FormPanel.findByType
获取对所有标签的引用,将标签宽度设置为 200,然后然后调用FormPanel.doLayout
?Could it be that the
labelWidth
config option is not taken into consideration anymore after the FormPanel is rendered? Maybe you could acquire a reference to all the labels withFormPanel.findByType
, set the label widths to 200, and then callingFormPanel.doLayout
?