Skip to Content
avatar image
Former Member

How to change custom column position in smart table

Hi, experts.

I'm having a problem on the creation of a custom column inside a smart table.

Because I have buttons inside of it, it can't come from the backend, as far as I know.

The position of this custom column starts at the beginning of the table, but I want it to be the last column.

This is what I have so far:

<table:SmartTable header="{i18n>Templates}"
          id="idSmartTable"
          showRowCount="true"
          editable="false"
          persistencyKey="smartTablePKey"
          smartFilterId="idSmartFilterBar"
          entitySet="NotificationCollection"
          initiallyVisibleFields="title,collection,updated,Functions,changeType"
          useExportToExcel="false"
          tableType="ResponsiveTable"
          enableAutoBinding="true"
          class="sapUiResponsiveContentPadding">
    <Table class="sapUiSizeCompact">
      <columns>
        <Column popinHAlign="End">
          <customData>
            <core:CustomData key="p13nData" value='\{"columnKey": "changeType","leadingProperty": "changeType","sortProperty": "changeType","filterProperty": "changeType"}'/>
          </customData>
          <Text text="Functions"/>
        </Column>
      </columns>
      <items>
        <ColumnListItem type="Navigation">
          <cells>
            <HBox>
              <Button icon="sap-icon://add" text="Create Deal"/>
              <Text width="10px"/>
              <Button icon="sap-icon://edit"/>
              <Text width="10px"/>
              <Button icon="sap-icon://delete"/>
            </HBox>
          </cells>
        </ColumnListItem>
      </items>
    </Table>
  </table:SmartTable>

And this is the result:

capture2.png

If anyone knows how to solve this issue, it would be of great help.

Thank you.

Best Regards!

Richard Viana

capture2.png (32.2 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Oct 12, 2016 at 02:22 PM
    Add comment
    10|10000 characters needed characters exceeded

  • Oct 12, 2016 at 02:44 PM

    Hey Richard,

    include the following to value property.

    "columnIndex":"XX"

    Replace XX with the Index of your column starting by 0. To display the column on the end of the table i suggest 99.

    Regards

    Simon

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 08, 2017 at 03:22 AM

    Hi Experts,

    I have similar requirement, i want to make few columns visible in GROUP which is available by default in smart control setting, actually i am able to do that, as i am using <customData>, so i removed "sortProperty" which makes hidden from the Group option, but when i do so, the columns are getting hidden from the SORT also, i need to retain all columns in SORT, but not in GROUP, Please help

    a code snippet of custom column:

    <Column hAlign="Left">
    <customData>
    <core:CustomData key="p13nData" value='\{"columnKey": "EVT_DATE","leadingProperty": "EVT_DATE","filterProperty": "EVT_DATE"}'/>
    </customData>
    <Text text="{i18n>table_Date}"/>
    </Column>
    
    

    Thanks in advance,

    Pradeep.

    Add comment
    10|10000 characters needed characters exceeded