on 2025 Feb 05 10:30 AM
Hi,
Using the Flexible Programming Model Table in SAP UI 1.108, I cannot see an option in the API to disable manual resizing of Columns by the user. We would like to disable it.
Im talking about the users ability to drag a column when clocking on the seperation line or column header
Main reason ist that the responsive layout doesnt work properly anymore once the User resized a column.
What striked me as well that this is even possible with disabled Table Personalisation. This makes it impossible for the user to return to default if he resized the column
Request clarification before answering.
I solved this on 108 using
For later versions, Marian's response should be applied as it's a more elegant approach
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
please edit to not use "sap.ui.getCore" and more like "this.base.getView()" or something like that. "sap.ui.getCore" will be deprecated in UI5 2.0. But this is also a valiid approach, i do think this will work for a long time
i just used it because i executed it in the console and not in code
A bit disappointing that this is possible with sap.ui.mdc.Table but not with macros.Table.
But it is possible and that even without private APIs, you just have to start from the inner sap.m.Table
sap.m.plugins.ColumnResizer.findOn(sap.ui.getCore().byId("sap.fe.core.fpmExplorer.tableDefault::Default--LineItemTable-content-innerTable")).setEnabled(false)
This works here: https://ui5.sap.com/test-resources/sap/fe/core/fpmExplorer/index.html#/buildingBlocks/table/tableDef...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Marian,
thanks a lot for your response. This certainly is a new direction.
Unfortunately we're on 1.108 and findOn is not yet available for us.
I'll look into ways to adjust the sap.m.table by fetching it via id. I just wonder if this is much "better" than using private methods, I would expect this to be breaking easily when updating
@axel_brke3 i do not think this will break easily, you can just use some form of this code from UI5.
This is the "findOn" method:
PluginBase.getPlugin = function(oElement, vPlugin = PluginBase) {
// Keep this function in sync with sap.m.plugins.PluginBase.getPlugin
// until the library dependencies are cleaned up and a reuse can happen!
if (!oElement) {
return;
}
if (typeof vPlugin === "function" && vPlugin.getMetadata) {
vPlugin = vPlugin.getMetadata().getName();
}
const fnCheck = function(oElem) {
/* TBD Cleanup sap.m and sap.ui.table plugins should be aligned in future.*/
return oElem.isA(vPlugin) && (
oElem.isA(["sap.m.plugins.PluginBase", "sap.ui.table.plugins.PluginBase"]));
};
return oElement.getDependents().find(fnCheck) || oElement.findElements(false, fnCheck)[0];
};
User | Count |
---|---|
52 | |
8 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.