我到处都找不到这个。在sap.ui.table.Table控件中,是否可以告诉它调整所有列宽的大小,以使其内容完全可见?我在表或列实例上看不到任何属性/方法。
它不受支持吗?
非常感谢。
发布于 2016-09-07 21:21:46
您可以使用autoResizeColumn(colIndex)方法
发布于 2014-08-29 18:22:31
选项1:设置固定大小的列
var oTable = new sap.ui.table.Table({
width : "100%",
selectionMode : sap.ui.table.SelectionMode.None,
enableColumnFreeze : true,
});
oTable.addColumn(new sap.ui.table.Column({
template : new sap.ui.commons.TextView({
text : "{Title}",
wrapping : true,
textAlign : sap.ui.core.TextAlign.Begin,
}),
enableColumnFreeze : true,
width : '350px', // also possible in % -> e.g. in ur case '100%'
}));选项2:可调整大小,但显示完整的列宽,我将尝试使用这些属性
灵活宽度: true)
像这样
oTable.addColumn(new sap.ui.table.Column({
template : new sap.ui.commons.TextView({
text : "{Title}",
wrapping : true,
textAlign : sap.ui.core.TextAlign.Begin,
}),
width : '100%',
resizable : false,
flexible : false,
}));我认为这是一个挑战,我也是通过固定大小来实现的。最终,您可以根据屏幕大小定义固定的大小。希望能对您有所帮助。
发布于 2015-08-04 15:23:56
这对我来说很有效:
我的专栏是:
flexible: true,
resizable: true,
autoResizable: true,
width : 'auto'$($.find('.sapUiTableColRsz')).trigger("click");
https://stackoverflow.com/questions/23651001
复制相似问题