on 01-19-2015 3:28 PM
Dear SAPUI5 Experts,
Our goal is to resize the columns according to the string length of the json file data. Currently, following events and methods are available for sap.ui.table:
Event:
Method:
The sap.ui.colum offers autoResizable(boolean value) doesn´t show any changes. I also do not see major changes if I change the width of the columns to 100%.
My question is: How to implement these methods/events correctly?
Thank you very much in advance!
Best regards,
Rufat
AutoResize example here:
But the rendering is not the best 🙂
Also notice the API hint:
Experimental API:Experimental! Presently implemented to only work with pure text-based controls, the sap.ui.commons.Checkbox and sap.m.Image as well as sap.ui.commons.Image. It will also work for most simple input fields (TextField, CheckBox, but not ComboBox)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rufat,
I hope you are using sap.m.Table, there is a property "fixedLayout" make this false as it is true by default.
Hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kedar,
no, I don´t use the sap.m.table. There are pro´s and contra´s using for usage of sap.m.table and sap.ui.table which made us to choose the proper table for our desktop application. For example, the sap.ui.table didn´t have any properties for column reordering etc. while the sap.m.table offers paging functionalities out of the box....
Best regards,
Rufat
Is Auto-Width not enough for you?
There is a lot to do, to set the width by length of characters ...
=> 5 * 'i' has another width than 5 * 'm'
=> than you need to get the maximum length of each column by looping each cell
And the result will be a table with space at the right side (or with too much data, an overflow)
So the best way is auto-width I think.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
btw a column cannot have a width of 100% if you have more than one column.
All columns together have 100%
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.