a month ago - last edited 3 weeks ago
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 !
Request clarification before answering.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
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.
User | Count |
---|---|
88 | |
10 | |
9 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.