cancel
Showing results for 
Search instead for 
Did you mean: 

MDK - How to change the AccessoryType Icon on Grid table / Table with multi choice or delete button

age0110_
Explorer
0 Kudos
130

Hi Community,

I would like to have the ability to display a table and then have the ability to delete rows using multi select or with an icon on each row. So far the best alternative I found is to use Grid table and AccessoryType button. This option works since there is an event on the accessorytType however the icon is predefined and I don't see a way to change that to be a deletion button .

Any ideas of how to achieve this or another way to achieve my goal with a table ? If the icon cannot be changed via config maybe it is possible to do this through CSS? Any guideline  please ?

I have also checked other options like:

- object table: This has a multi select that I could use as selection for deletion but I do not want to use that since that is not a real table with columns...

- DataTable control: There is an option for AccessoryType but it does only give disclosure indicator icon and also the event is onPress and not on AccessoryType like the Grid table has so not sure what is the point of having that and not the event?... I have seen others advising to simulate the icon with an image on the data table but because the event at cell/column level is not there then that will not give a really good experience since tapping on any column will trigger the deletion and redraw of the table is required...( correct me if I am wrong..)

Any help will be highly appreciated !

Accepted Solutions (0)

Answers (1)

Answers (1)

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

MDK does not currently have the ability to customize the accessory image on a Data Table or Grid Table and as you mention there is no separate event for just that indicator.  Data Table and Grid Table have the indicator to help cue a user that clicking on a row will show more detail.

One option might be to put the table into a "delete" mode where a user could select one or more rows to be deleted.  Using an image columns and the row on click to select/deselect the items and then pressing a header or footer button to finalize and actually perform the delete.

age0110_
Explorer
0 Kudos

Many thanks Bill

so basically you mean to have an image that looks like a checkbox and then swap the image every time the user click on the row?I have seen this workaround proposed a few years back however I cannot find any sample code for it which I found strange since it must be a common thing people ask for... Would you be able to provide any sample code or refer to any place where there is a sample code for this? 

On the other hand are you aware if following missing features( please correct me if I am wrong on any of them) are coming anytime soon in MDK for grid/data tables ?

- Multi select/single select

- Custom AccessoryType Icon

- Button type cell with event handler

- Checkbox cell with event handler

- Header in Grid/Data Table to be able to add buttons or change AccesoryType Icon so we can add edit/add/delete buttons if needed specially on iPads.

- Footer in Grid/Data table to be able to add cells instead of just 1 label so we can do add Totals to the table 

Thanks!

 

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos
Correct. You would track the current state in page client data or if you have a field on the entity you could update as well and the use that state tracker to determine which image to show.
bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

Regarding your list of requested features, as this functionality is currently not available in MDK standard control, I would suggest you to open a feature request here. We'll review it based on its priority.