cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hello,

I got a smart table without a variant. And I want to resize the standard fields which come over annotations. I manage the resizing with my own custom fields. But not with the standard ones.

I tried this in the controller - but it doesn't work:

	oTable.getColumns().forEach(function (oColumn) {
				if (oColumn.sId.includes("Matnr") || oColumn.sId.includes("Aufnr")) {
					oColumn.setWidth("30%");
					//oTable.autoResizeColumn(oColumn.getIndex());
				}
			
			});

I tried this at the afterRendering function and in the data-received Event of the table..

Simply doesn't work at all.

Thanks.

0 Likes
View Entire Topic
ThorstenHoefer
Active Contributor
0 Likes

Hi,

you can get the used table (e.g. sap.m.Table) with

_oSmartTable.getTable().

sap.m.Table has the event updateFinished. Try to modify the columns here.

Sample Code

<smartTable:SmartTable tableType="ResponsiveTable" >
  <m:Table updateFinished=".doModifyColumn">
  </m:Table>
</smartTable:SmartTable>

doModifyColumn: function(oEvent){
var oTable = oEvent.getSource();
oTable.getColumns().forEach(function (oColumn) {
  f (oColumn.sId.includes("Matnr") || oColumn.sId.includes("Aufnr")) {
					oColumn.setWidth("30%");
					//oTable.autoResizeColumn(oColumn.getIndex());
				}
			
			});
			
}