Hide or Disable Action Button under dhq_card_grid

Team,

I am using mysql DB connector to get data from the server. I am using dhq_card_grid to show some data with action. How can we disable or hide one action button when one specific criteria is matched. For example, if a user already cancel his schedule, cancel button should not function 2nd time.

can you guide me how can hide action button based on Schedule Status, for example if schedule status is Executed then All three options should be hidden but if Pending then all three should highlight & work as per workflow.

@kundan.jha

This card has a pre-defined set of actions which aren’t dynamic. You can handle in the Action flow for each of the button based on the Status of the current card item and display a Toast or error message to the user.

Another solution would be you have a 2 different tables, one with Buttons and other without buttons, and based on the filter selected - Pending OR Executed you can show/hide corresponding table accordingly using rules.

Hope this Helps!

1st Solution is looking good, can you give me any reference on how we can achieve this?

@kundan.jha

You can add branch to your respective actions and in condition you can have a condition as -

list.schedulestatus = "Executed"

And in your other branch you can have a condition like -

list.schedulestatus <> "Executed"

And based on that you can then add additional action in your respective branch.

PS. - Check your list control property to help identify which button belongs to your action click event. For Example, as shown below Approve button click corresponds to action2_click event.

Hope this Helps!

1 Like