on 01-18-2018 6:09 AM
Hello Developers,
I'm using sap.ui.table component and I would like to set the column width value "auto" depending on cell content value's width. But I couldn't do that. How can I set auto width columns ?
Here is a part of my code and screenshot;
for (var i = 0; i < json.length; i++) {
oTable.addColumn(new sap.ui.table.Column({
label: new sap.m.Label({
text: json[i].Value,
}),
template: new sap.m.Text({
text: '{' + json[i].Key + '}',
wrapping : false,
textAlign : sap.ui.core.TextAlign.Begin,
}),
sortProperty: json[i].Key,
filterProperty: json[i].Key,
width : 'auto',
resizable : false,
flexible : false,
//enableGrouping : json[i].enableGrouping,
//visible : json[i].visible,
}));
oTable.autoResizeColumn(i);})
Here is the result image;
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.