Gwt 调整listgrid的可调整大小的条宽度
在我的ui中有一个listgrid,我为它设置了大小500Gwt 调整listgrid的可调整大小的条宽度,gwt,smartgwt,Gwt,Smartgwt,在我的ui中有一个listgrid,我为它设置了大小500 dataGrid=new ListGrid(); dataGrid.setWidth(500); 我想为listgrid使用可调整大小的栏 dataGrid.setShowResizeBar(true) 但可调整大小的条的默认宽度是>300,这使得我的ui不好看 有没有办法将可调整大小的条宽度精确设置为500或任意大小 谢谢我不知道你的UI看起来如何,所以很难判断,但我更喜欢使用setResizeFrom(String…resizeF
dataGrid=new ListGrid();
dataGrid.setWidth(500);
我想为listgrid使用可调整大小的栏dataGrid.setShowResizeBar(true)代码>
但可调整大小的条的默认宽度是>300,这使得我的ui不好看
有没有办法将可调整大小的条宽度精确设置为500或任意大小
谢谢我不知道你的UI看起来如何,所以很难判断,但我更喜欢使用setResizeFrom(String…resizeFrom)来定义大小调整方向
看。
希望这有帮助 您可以使用ListGridField.setWidth()为ListGrid中任何可调整大小的列设置默认宽度,如下所示:
// first create the grid and set columns to be resizable
dataGrid=new ListGrid();
dataGrid.setWidth(500);
dataGrid.setShowResizeBar(true);
dataGrid.setCanDragResize(true);
// set each column to the initial width you want for that column
ListGridField myColumn= new ListGridField("myColumn", "My Column");
myColumn.setWidth(400); // default to 400 pixels wide
ListGridField myAnotherColumn= new ListGridField("myAnotherColumn", "Another Column");
myAnotherColumn.setWidth(300); // default to 300 pixels wide
dataGrid.setFields(myColumn, myAnotherColumn);