title: Sapui5: How can I set an initial sort order in smarttable?
body: <p>I have a smart table. How can I set an initial sort order on one or multiple columns of the smarttable?</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;mvc:View xmlns:m=&quot;sap.m&quot; xmlns:mvc=&quot;sap.ui.core.mvc&quot; xmlns:semantic=&quot;sap.m.semantic&quot; xmlns:footerbar=&quot;sap.ushell.ui.footerbar&quot;
      xmlns:smartFilterBar=&quot;sap.ui.comp.smartfilterbar&quot; xmlns:smartTable=&quot;sap.ui.comp.smarttable&quot;
      xmlns:app=&quot;http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1&quot;
      controllerName=&quot;audi.project.definition.controller.Worklist&quot;&gt;
      &lt;semantic:SemanticPage id=&quot;page&quot;&gt;
          &lt;semantic:content&gt;
              &lt;smartTable:SmartTable id=&quot;smartTable&quot; entitySet=&quot;ProjectHeaderSet&quot; tableBindingPath=&quot;/ProjectHeaderSet&quot;
                  app:p13nDialogSettings=&quot;{sort:{items:[{
                      columnKey: 'Description',
                      operation: 'Ascending'
                  }]}}&quot; 
                  header=&quot;{i18n&gt;/X000558}&quot; showRowCount=&quot;true&quot; tableType=&quot;Responsive&quot; smartFilterId=&quot;prdefWorklistFilterBarId&quot;
                  showFullScreenButton=&quot;true&quot; useVariantManagement=&quot;false&quot; enableAutoBinding=&quot;true&quot; ignoredFields=&quot;WbsElement,Method,Refnumber&quot;
                  initiallyVisibleFields=&quot;ProjectDefinition,Description,ZProjecttypeName,ZMsSchemeText&quot;&gt;
                  &lt;smartTable:customToolbar&gt;
                      &lt;m:OverflowToolbar design=&quot;Transparent&quot;&gt;
                          &lt;m:ToolbarSpacer/&gt;
                          &lt;m:SearchField id=&quot;searchField&quot; tooltip=&quot;{i18n&gt;/X000559}&quot; width=&quot;auto&quot; search=&quot;onSearch&quot; liveChange=&quot;onSearchLiveChange&quot;&gt;&lt;/m:SearchField&gt;
                          &lt;m:Button type=&quot;Transparent&quot; press=&quot;onCreateBtnPress&quot; icon=&quot;sap-icon://add&quot; tooltip=&quot;{i18n&gt;/X000053}&quot;/&gt;
                          &lt;m:Button type=&quot;Transparent&quot; press=&quot;onDeleteBtnPress&quot; icon=&quot;sap-icon://delete&quot; tooltip=&quot;{i18n&gt;/X000058}&quot;/&gt;
                      &lt;/m:OverflowToolbar&gt;
                  &lt;/smartTable:customToolbar&gt;
                  &lt;m:Table id=&quot;table&quot; mode=&quot;MultiSelect&quot;&gt;
                      &lt;m:items&gt;
                          &lt;m:ColumnListItem type=&quot;Navigation&quot; press=&quot;onPress&quot;/&gt;
                      &lt;/m:items&gt;
                  &lt;/m:Table&gt;
              &lt;/smartTable:SmartTable&gt;
          &lt;/semantic:content&gt;
      &lt;/semantic:SemanticPage&gt;
  &lt;/mvc:View&gt;
  </code></pre>
  <p>The only part that could be one solution is here:</p>
  <pre class="lang-js prettyprint-override"><code>app:p13nDialogSettings=&quot;{sort:{items:[{
      columnKey: 'Description',
      operation: 'Ascending'
  }]}}&quot;
  </code></pre>