将Flex值动态添加到extjs中的控制器(Add Flex value dynamically to controller in extjs)

编程入门 行业动态 更新时间:2024-10-23 13:24:00
将Flex值动态添加到extjs中的控制器(Add Flex value dynamically to controller in extjs)

我在“视图”中给出了一些项目(容器),一个hbox的布局。 现在我想通过“Controller”为每个项目赋予flex值。 我怎样才能做到这一点?

我已经浏览了文档,但找不到像setFlex这样的setFlex 。

编辑

Ext.apply(Ext.getCmp('IdHere'), {flex: 1});

我从这个链接得到了答案。 但现在的问题是,即使我动态更改flex值,容器的视图也不会改变。 它保持不变。

我最初没有在“View”中指定flex值,如此处所述

I am giving some items (containers), in "View", a layout of hbox. Now I want to give flex value to each item through the "Controller". How can I do this?

I have gone through the docs but can't find any method like setFlex.

EDIT :

Ext.apply(Ext.getCmp('IdHere'), {flex: 1});

I have got the answer from this link. But now the problem is that even I am changing the flex values dynamically, the view of the containers is not changing. It is remaining same.

I am not assigning flex values initially in "View" as stated here

最满意答案

我的第一个猜测是需要通过调用doLayout()重新运行布局过程我不太确定,但我认为你必须调用保存hbox布局的父元素。

My first guess would be that need to rerun the layout process by calling doLayout() I am not quite sure but I think you have to call in on the parent element which holds the hbox layout.

更多推荐

本文发布于:2023-07-24 10:48:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1244965.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控制器   动态   extjs   Flex   dynamically

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!