setWidth("*")在CSS/SmartGWT中做了什么?

ric*_*ich 4 css gwt smartgwt

我遇到过一些使用SmartGWT的遗留代码.我怀疑API也存在于标准GWT中.

widget.setWidth("*");
Run Code Online (Sandbox Code Playgroud)

请记住,相同的代码有:

otherWidget.setWidth100();
Run Code Online (Sandbox Code Playgroud)

我不知道CSS有类似的东西:

width: *;
Run Code Online (Sandbox Code Playgroud)

所以...这段代码是合法的,如果是这样,它做了什么......或者不是吗?!

提前致谢.

min*_*ate 6

在SmartGWT中.setWidth("*")意味着占用剩余的可用宽度.例如,如果你有一个HPanel有两个孩子的孩子,其中一个孩子有setWidth("10%")隐含的孩子,那么孩子的setWidth("*"宽度为90%.这允许您更改一个孩子的宽度,而无需更新其他setWidth呼叫.