Skip to Content
1
Former Member
Sep 27, 2013 at 08:23 AM

How to sort and filter calculated fields in a table?

232 Views

Hi all,

how can the "sortProperty" and "filterProperty" of a table column be filled, when there isnt a corresponding property in the model, but the value for the column was calculated?

Example:

new sap.ui.table.Column({    label: "my label",    template: new sap.ui.commons.TextView({         text:{            parts: [                {path: "Model>Prop1"},                {path: "Model>Prop2"}            ],            formatter : function(prop1, prop2){                var calcValue = prop1 + prop2;                return calcValue;            },        },         textAlign: sap.ui.core.TextAlign.Right     }),    sortProperty: "calcValue",    filterProperty: "calcValue"}),

Regards

Stefan