Skip to Content

SAPUI5 column not lining up correctly

Hello ,

I have a table in sap.ui.table.Table structure. My columns are of type sap.ui.table.Column.

My problem:

Sorting is not correct in my columns with numeric values.

Columns with string data sort correctly.

The data in the column comes from Hybris data as JSON.

The structure I use for numerical columns:

oTable.addColumn(new sap.ui.table.Column({name:code,
label: new sap.ui.commons.Label({text: name,}),
template: new sap.m.ObjectNumber({textAlign: "Center",
number: {path: code,
type: "sap.ui.model.odata.type.Decimal",
formatOptions: {decimals: 3,
groupingEnabled: true,
groupingSeparator: ".",
decimalSeparator: ","} } }),
/*template: new sap.m.Text().bindProperty("text", { path:code, type: 'sap.ui.model.type.Integer' } ),*/sortProperty: code,
filterProperty: code,
width:"100px",
resizable: true,
}));
Column structure of string data:
oTable.addColumn(new sap.ui.table.Column({
    name:code,
    label: new sap.ui.commons.Label({text: name,}),
    template: new sap.ui.commons.TextView().bindProperty("text", code ),
    sortProperty: code,
    filterProperty: code,
    width:"100px",
    resizable: true,
}));









Thank you very much in advance.
nmeq4.png (28.4 kB)
nvend.png (25.1 kB)
ixyz1.png (25.1 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

0 Answers

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.