cancel
Showing results for 
Search instead for 
Did you mean: 

How to Enable Multiple Selection Mode in a Data Table in SAP MDK?

vivekv
Explorer
0 Kudos

Hello everyone,

I'm working on a SAP MDK project where I need to create a table with multiple columns, similar to the sap.m. Table in Fiori, and enable multiple selection mode. So far, I've managed to create a Table with several columns using the Sectioned Data Table control. 

vivekv_1-1716066062448.jpeg

Problem:

I need to enable a selection mode where users can select multiple rows in this Data Table. I have looked into the available options in SAP MDK, but I have not found a straightforward way to enable multiple selection mode in the current control.

Questions:

  1. Is there any alternative control in SAP MDK that allows the creation of a table with multiple columns and supports multiple selection mode?
  2. If this is a limitation with the current Data Table control, what would be the best way to overcome it?
  3. Are there any workarounds or custom implementations that could help achieve this functionality?

I appreciate any suggestions or guidance from the community on how to achieve this.

Thank you!

Accepted Solutions (0)

Answers (2)

Answers (2)

bill_froelich
Product and Topic Expert
Product and Topic Expert

While Data Table does not support multiple selection you could simulate it by using a image column and an unselected and selected image to let the user know what is currently selected.  You would need to add rules to return the correct image to show along with a rule to toggle the selected state saving the item somewhere when pressed (one place could be client data on the page).  The one downside is you will need to redraw the while data table when a selection is made which isn't ideal but would provide you the desired functionality.

vivekv
Explorer
0 Kudos

Hi Bill Froelich,

Thank you for your suggestion on simulating multi-selection using an image column. I appreciate your detailed response and the workaround you provided. It's an interesting approach, and I have seen your comments on a similar issue in another community post from 2021, which I am already exploring: Multi-selection Table Control.

In our specific scenario, we are building an application for creating sales orders with added features, where users need to select multiple products and update various details inline, such as quantities. While implementing the image column to simulate selection can work, it doesn't fully address our need to allow inline editing of these fields directly within the table. 

Here's a sample picture illustrating our requirement for editable fields within the table, 

vivekv_0-1716233921358.png

Additionally, we have an action column intended for delete and copy operations. However, since the control only supports row-level events and lacks cell-level press events, implementing these actions through the action column is challenging. As an alternative, we could introduce multi-select functionality through a work around and add separate buttons at the header level to perform these actions.

vivekv_1-1716234652797.png

Additionally, as far as my understanding goes, enabling the edit mode for the table makes all fields editable, and we currently do not have options to restrict editability to specific columns. Do we have options over making specific columns editable while keeping others non-editable?

The current limitation of redrawing the entire Data Table upon selection adds complexity, especially when users need to make quick updates to multiple rows. We need a solution that not only simulates multi-selection but also supports selective inline editing of fields like product quantities and other related details.

Any further suggestions on how we can achieve this would be greatly appreciated.

Thank you once again for your support and insights.

Best regards,
Vivek V

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos
Restricitng editing to a subset of columns is a feature that will be introduced in the next release.
Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert

Data Table control doesn't support multi-selection mode. You can use the Object Table control that supports multi-selection

vivekv
Explorer
0 Kudos

Hi Jitendra,

Thanks for your suggestion.

I have considered the Object Table control, but it appears more like a list and doesn't seem to support displaying multiple columns to show detailed information. The Object Table control provides around 3 or 4 places where text can be bound, but we need to display more. We are developing the specifically for tablet use.

Is there any way to enhance the Object Table to display more columns, or is there another control that better supports a multi-column layout with multi-selection capabilities. We're aiming for a solution that works well on tablet devices.

Any suggestions would be greatly appreciated.

Best Regards,

Vivek V