49
Views
2
Comments
Highlight list item when clicked and remove highlight when clicked again
Question

Hello,

I have a list of items which i would like to give the user the option to batch delete.

I would like a way to highlight an item when clicked so the user knows when the item is selected for deletion and remove highlight when clicked again to show it has been removed from the delete list.

The user can select multiple items at once, so the items should stay highlighted even when another item is selected.

Currently I have an Onclick action that adds the item a list on the first click and on second click it is removed from the list, however I do not know if there is a way to look through the list in the expression editor so I can say "if it is in the list it should have this style" or if there is another way to do this.


Thank you in advance

2022-03-29 14-13-57
Hassan Shaddad

hi  @Isaac Wangombe 

in your card add a Boolean parameter [IsSelected]

 and add css class depend on it [if  (IsSelected  , red , green ) ]

and on click set the parameter to [not IsSelected  ] and add the item to the list or remove it from it

2023-05-23 04-55-55
Wasimkhan Syed Abuthahir

Hi,

Adding to the above comment,

If the card item is list. Then add "IsSelected" attribute in structure of the list and keep the default value as "False".

and in onclick action. write your logic, 

Structure.List.Current.Items.IsSelected = not Structure.List.Current.Items.IsSeleted


Regards,

Wasimkhan S


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.