Skip to Content
0

How to change custom column position in smart table

Oct 12, 2016 at 10:53 AM

902

avatar image
Former Member

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)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Jamie Cawley
Oct 12, 2016 at 02:22 PM
1
Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thank you Jamie!

This worked like a charm.

Regards,

Richard Viana

1
Simon Perstorfer Oct 12, 2016 at 02:44 PM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thank you Simon!

Worked perfectly. Didn't know about this property.

Regards,

Richard Viana

0
avatar image
Former Member
Aug 08, 2017 at 03:22 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded