Skip to Content
0

How to remove Select ALL checkbox from sap.ui.table

Feb 12 at 11:01 AM

160

avatar image
Former Member

Hi,

i am new to SAPUI5,

i am creating an application in which there are lot of rows with checkbox

i am using sap.ui.table. In my application i need to render the table dynamically as per the oData serivce provided.

i am using onrowSelected event of the table to trigger the event when checked. when every the row is checked it is added to an array.

consider i have 3 rows.

if i select anyone row 1 event is triggered.

if i select selected All after that 1 row selected. it the column triggers 3 event.

that means i have 4 events in the array.

so that a problem. to solve this i need to remove select ALL check box from the table..

can someone help me out to resolve this issue.....

thank you,

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Efim Parshin Feb 12 at 11:26 AM
0

Hi! You can do this inside controller (for example inside onAfterRendering hook):

var oTable = this.byId('MyTableId');
oTable._getSelectAllCheckbox().setVisible(false);

or just hide it via css.

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

thank you Efim for your reply.

I found a solution for that problem,

i used a Set to store all the selected. so that even when i select 1 row and do select All,

there will be no duplicates. since it is a SET.

Again, thank you for response.

0
Sagarika Gattu Feb 13 at 05:56 PM
0

Hello ,

Use the below property inside the view for the table.

enableSelectAll="false"

Example :

<Table
rows="{/ProductCollection}"
title="Products"
enableSelectAll="false"
selectionMode="MultiToggle"
rowSelectionChange="onSelect">
Share
10 |10000 characters needed characters left characters exceeded