cancel
Showing results for 
Search instead for 
Did you mean: 

Hiding a table column?

former_member239819
Participant
0 Kudos

I have a a table rendered from an xml view.

Is there a way I can hide an entire column in the controller?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI,

Try this link, table.getColumns()[column no].setProperty("visible",false); to hide and and table.getColumns()[column no].setProperty("visible",true); to show

Ref:

sapui5bin/dynamicTableColumns.html at master · qmacro/sapui5bin · GitHub

former_member239819
Participant
0 Kudos

Thank you. Almost there....


As the table was not created programmatically in the controller (it's just in the xml view), How do I actually access the table in the controller ?

Former Member
0 Kudos

Hi,

In xml creation of table create with id

<Table

    id="tt"

    rows="{

        path: '/Employees',

        parameters: {

            select: 'FirstName, LastName, BirthDate'

        }

    }"

    title="Table Example"

    visibleRowCount="7"

    firstVisibleRow="3">

    <columns>...  

    </columns>

</Table>

and in controller we can access using id  oView.byId("tt").getColumns()[2]. ....

former_member239819
Participant

Thank you very much, problem solved!

Answers (0)