Show buttons in Panel Operations or Operations w/Record as Disabled

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jhstephenson
Posts: 303
Joined: Wed Apr 22, 2015 11:44 pm

Show buttons in Panel Operations or Operations w/Record as Disabled

Post by Jhstephenson »

Is it possible to have a button show as disabled, not completely disappear, from Panel Operations or the column it is on for each record?

I want the appearance on some screens to be very consistent, but just block the use of a button if it is not applicable to a user or some condition.
PointsWell
Posts: 1473
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Show buttons in Panel Operations or Operations w/Record as Disabled

Post by PointsWell »

I was unable to achieve this and if you have buttons after the one hidden then these move all the other buttons over one space which makes for a random UX.

What I did to work around this was to use a non functioning operation (on forms I use wizard page next which does nothing on a non wizard form) coupled with a deliberately incorrect Font Awesome glyph misspelled in case they make one called Gibberish

I thens set the opposite visibility rule to the button it replaces

Eg
Edit hide when Contact.Status="Dormant"
EditSpacer hide when Contact.Status<>"Dormant"

I have asked Vlad for an option to add a spacer button that doesn't require a fake operation and fake glyph, but I obviously didn't make a strong enough case for it.

A better option would be a Disabled when function to allow the button to be greyed out (or with a null glyph) and inoperative based on hide when conditions as this would leave the UI unaltered and consistent for every BO state
Jhstephenson
Posts: 303
Joined: Wed Apr 22, 2015 11:44 pm

Re: Show buttons in Panel Operations or Operations w/Record as Disabled

Post by Jhstephenson »

Thanks PointsWell. That last option is what I am hoping for.
Jaymer
Posts: 2528
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Show buttons in Panel Operations or Operations w/Record as Disabled

Post by Jaymer »

In the event you have an HTML cell where you place buttons, you can modify the default class to make it appear dimmed (ie. disabled).

You can see the conditional code that either displays the valid button, OR a "disabled" button.
I also call a process named "dummy" as a placeholder.
Inspecting the Log shows that the dummy process IS NOT actually called - apparently NOTHING is happening when you click the button. Other combinations of Classes that I tested still called the process, but this was the combination I came up with to get what I needed.

Given this info (and until Aware has a better option built in for Panel Operations) perhaps this strategy could be used on those buttons also.

-->JaymerTip Show button as disabled in HTML cell on Form
Attachments
Screen Shot 2021-02-15 at 9.31.49 PM.png
Screen Shot 2021-02-15 at 9.31.49 PM.png (159.85 KiB) Viewed 11205 times
Screen Shot 2021-02-15 at 9.31.49 PM.png
Screen Shot 2021-02-15 at 9.31.49 PM.png (32.21 KiB) Viewed 11205 times
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Posts: 2528
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Show buttons in Panel Operations or Operations w/Record as Disabled

Post by Jaymer »

Rather than mess with a SECTION_START (and a 2nd SECTION for the dimmed button),
it seems like it would be easier/cleaner to use the Script field.

Then the cell contains simpler code (ie. just the default Button code),
and the Script has code to alter the CSS class of the cell.

Something like: IF (data("ClosedYN") eq 1) {document.getElementById("btn1").className = "k-button k-state-disabled"; }

(this doesn't actually work - i didn't want to put time into figuring out the exact JS needed. But, once that is solved, then it would be easy to conditionally disable buttons. AND THIS METHOD WOULD WORK on Panel Operations)
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jhstephenson
Posts: 303
Joined: Wed Apr 22, 2015 11:44 pm

Re: Show buttons in Panel Operations or Operations w/Record as Disabled

Post by Jhstephenson »

Thanks Jaymer, I will have to play with that.
edvwruhs
Posts: 20
Joined: Wed Jan 18, 2023 11:18 pm

Re: Show buttons in Panel Operations or Operations w/Record as Disabled

Post by edvwruhs »

Jaymer wrote: Tue Feb 16, 2021 2:42 am In the event you have an HTML cell where you place buttons, you can modify the default class to make it appear dimmed (ie. disabled).

You can see the conditional code that either displays the valid button, OR a "disabled" button.
I also call a process named "dummy" as a placeholder.
Inspecting the Log shows that the dummy process IS NOT actually called - apparently NOTHING is happening when you click the button. Other combinations of Classes that I tested still called the process, but this was the combination I came up with to get what I needed.

Given this info (and until Aware has a better option built in for Panel Operations) perhaps this strategy could be used on those buttons also.

-->JaymerTip Show button as disabled in HTML cell on Form

Hey Jaymer, just a quick question how did you position the button next to the field? When I try to drag and drop the button next to the field the field gets just replaced with the button.

Any idea how I can solve this?


Best Regards
Jaymer
Posts: 2528
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Show buttons in Panel Operations or Operations w/Record as Disabled

Post by Jaymer »

Had to add a column just to contain that. That’s why it’s wayyyyy over there.
But it could be done with css tinkering too.

Also, see this
https://www.awareim.com/forum/viewtopic.php?f=4&t=11505
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Post Reply