on ‎2021 Nov 30 11:43 AM
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.
Request clarification before answering.
Thanks Thorsten. But the question is not the call but why the setWidth() isn't working and what I can do about it..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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());
}
});
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.