Skip to Content

Initial Filter SmarTable SAPUI5

I'm trying to set an initial sort for the SmarTable component, but it's only applied visually. Below is my code.View:
<smartTable:SmartTable entitySet="CustomerOrders" id="tbOrders" tableType="Table" useExportToExcel="true" beforeExport="onBeforeExport"
				header="Ordens de Manutenção" showRowCount="true" enableAutoBinding="true" beforeRebindTable="onBeforeRebindTable"
				initiallyVisibleFields="PriorityName,OrderTypeType,OrderTypeName,Id,DateOpen,HourOpen,BrandName,EquipmentId,EquipmentNumber,SymptomName"
				class="sapUiResponsiveContentPadding">

Controller:
onBeforeRebindTable: function(oEvent) {
    var oSmartTable = oEvent.getSource();
    if (this._isOnInit == null) this._isOnInit = true; //To set this initial sorter only when view start
    if (this._isOnInit) {
        oSmartTable.applyVariant({
            sort: {
                sortItems: [{
                        columnKey: "PriorityName",
                        operation: "Ascending"
                    }
                ]
            }
        });
        this._isOnInit = false;
    }
},


But only show the order icon and.


The correct order:
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Apr 16 at 10:13 AM

    Hi Marcos,

    What do you mean with "but it's only applied visually"? I understand the sort is applied but not in the way you want? What is the behavior and the expected one? The SAPUI5 version you are using would be useful too.

    Best regards,

    Désirée

    Add comment
    10|10000 characters needed characters exceeded