cancel
Showing results for 
Search instead for 
Did you mean: 

Sorting not working on object Page Item table SAP CAP BTP Fiori elements

nikhil180490
Explorer
0 Kudos

Hello All Members 

I have created an application using Fiori elements on SAP CAP BTP  list report page template , In object page I have an item table which can be sorted I have put the annotations to sort a field by default which is working but if I try to sort other columns using sort the table crashes and the application goes irregular below is some of the code snippet 
If someone know where I am going please help in correcting that 
The code might  not be properly copy pasted but there is no error in code please let me know for any solution on this 

In Manifest.json  file 

    "to_MucItems/@com.sap.vocabularies.UI.v1.LineItem#GOBTableSection": {
                  "tableSettings": {
                    "condensedTableLayout": true,
                    "enhanceI18n": "i18n/muc.properties",
                    "enableExport": true,
                    "enableFullScreen": true,
                    "enablePaste": true,
                    "selectAll": true,
                    "type": "GridTable",
                    "selectionMode": "Multi",
                    "creationMode": {
                      "createAtEnd": true,
                      "inlineCreationRowsHiddenInEditMode": true
                    },
                    "personalization": {
                      "column": true,
                      "sort" : true
                    }
                }

Annotation.cds file 

annotate service.mucHeader with @(
    UI.Facets : [
        {
        {
            $Type : 'UI.ReferenceFacet',
            Label : 'Item Details',
            ID : 'GOBTableSection',
            Target : 'to_MucItems/@UI.PresentationVariant#GOBTableSection',
            ![@UI.Hidden] : hideGOB,
        },}]

annotate service.mucItem with @(UI.PresentationVariant #GOBTableSection: {
  // $Type         : 'UI.PresentationVariantType',
   Visualizations: ['@UI.LineItem#GOBTableSection' ],
    // Total : [amount],
    SortOrder     : [{
        $Type     : 'Common.SortOrderType',
        Property  : lineNumber,
        Descending: false,
    }, ],
});
 
Line item definition 
annotate CatalogService.mucItem with @(UI.LineItem #GOBTableSection: [
    {
        $Type                : 'UI.DataField',
        Value                : lineNumber,
        Label                : '{i18n>lineNumber}',
        ![@HTML5.CssDefaults]: {width: '5REM'},
    },
    {
        $Type                : 'UI.DataField',
        Value                : article,
        Label                : '{i18n>article}',
        ![@HTML5.CssDefaults]: {width: '10REM'},

    },
    {
        $Type                : 'UI.DataField',
        Value                : articleDesc,
        Label                : '{i18n>articleDesc}',
        ![@HTML5.CssDefaults]: {width: '15REM'},
    },
]);







 

 

Accepted Solutions (0)

Answers (0)