Loading...
 
Features / Usability

Features / Usability


[SOLVED] What is the correct LIST syntax to add 'delete' (item) functionality?

posts: 228 Ukraine

In Plugin Tracker List there is an option to add a 'Delete' column (called 'Action'):

Show Delete PluginTrackerList

which looks like this when added:

Delete (action) Option

I'm sure there is similar functionality in Plugin LIST, however, after reviewing all the Docs I did not find it. Also, I tried the 'Convert to LIST' feature (from Plugin Tracker List) but it did not convert (nor was an message provided that it was not converted...)

So I tried a number of options starting with the simple, just adding a 'display' at the very top (so above the 'Column' section), tried a few variations:

  • {display name="action" format="trackerrender"}
  • {display name="delete"}
  • {display name="delete" format="trackerrender"}
  • probably a few more, none seemed to work.


So next I added the 'Column' and 'Filter' lines:

  • {column field="tracker_item_delete" label="DELETE?" sort="tracker_item_delete" mode="raw"}
  • {FORMAT(name="tracker_item_delete")}{display default="" name="tracker_item_delete" format="trackerrender"}{FORMAT}
  • in addition to the one example above I also tried variations like "tracker_delete", "tracker_action" "tracker_item_remove", but none seemed to work.


Can't help but think i'm close, anyone know how to configure this correctly?

Thanks,
Mike

posts: 8633 Israel

Not exactly what you asked but this is how I solved this. ;-)

In the plugin List template I have:

Copy to clipboard
<a href="tiki-tracker-remove_item?trackerId=11&itemId={$row.object_id}&modal=1" class="btn btn-danger text-white click-modal"><i class="fa fa-trash-alt"></i></a>

It create a red button with a trashcan (I guess we can also use the button or even the icon plugin too)

posts: 228 Ukraine

That worked! Thanks Jonny!

When / If it is added to LIST, it might be a good idea to allow users to pass through a few variables from the Tracker (e.g. fields) so that the 'Confirm Delete' will be of more value - I could easily see a user working on a small screen (e.g. smartphone) who picks out the item to delete, than swipes left to get to the Delete column on the right, but in the process it also slightly swipes up, resulting in the incorrect item being deleted.

Simple work around, just put the trash can in the first column next to the identifying data, or somewhere near the identifying data (may look strange in the beginning or middle of a table, but if that's what gets the job done...)


posts: 228 Ukraine

Hi Bernard,

thanks for the code above and this link to the bug report. I guess we will have to wait to see if other 'LIST Experts' report the same issues ( @Jonny Bradley @Roberto Kirschbaum nudge, nudge, wink, wink)

While I don't know how to use the code entirely (tried a number of variations) the part with 'tiki-tracker-remove-item' sheds some light on the correct formatting (tracker_remove_items, or, the full path from permissions tiki_p_remove_tracker_items)

Do you 'pass though' variables in the confirm delete pop-up? While this pop-up is nice and necessary, without some variables from the item for confirmation it would be easy for a user to delete the item above or below where they thought they clicked.

@Roberto Kirschbaum created a nice 'click-modal' for one project that passed through some variables to link two Tracker items, but it was one button at the bottom of the LIST and only for new items, not at the end of each row for existing items. I'll have to see if I can combine that one and yours (pending any bug confirmations/fixes)

Thanks,
Mike


posts: 8633 Israel

Darn...

I tested on the instance at : https://dev.tiki.org/item7702-WIP-Delete-Edit-button-are-not-displayed-anymore-for-an-item-list-in-the-plugin-List

And it work fine. I just don’t know why between updates it stopped to work on my Tiki22. 😱

As you can see the display is a bit awkward and that’s why I created a custom template.
I will try to see what changed on my Tiki22 and fix that. (hopefully)

Roberto Kirschbaum created a nice 'click-modal' for one project that passed through some variables to link two Tracker items, but it was one button at the bottom of the LIST and only for new items, not at the end of each row for existing items. I'll have to see if I can combine that one and yours (pending any bug confirmations/fixes)


I’ll be glad to see...


Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting