on 12-29-2021 2:44 AM
Hi,
how to change button back-ground and text color when it is selected/enabled using CSS in Analytic application?
i have two buttons and background and text color should be changed for the button which is selected.
thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi avsalynin , Is there a way to change selected button color? every time i click on the button, it should change the color and remain on the same color until I click on another button.
thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You'll need to add CSS scripting to all your buttons,
e.g. if we have 2 buttons
btn_detail
btn_summary
create 2 custom CSS styles:
.BUTTONP .sap-custom-button{background-color: #8a4167} (purple ish hex colour code)
.BUTTONG .sap-custom-button{background-color: #a49f9e} (grey ish hex colour code)
In the 'onClick' event for btn_detail use the script:
btn_detail.setCssClass('BUTTONP');<br>btn_summary.setCssClass('BUTTONG');<br>
In the 'onClick' event for btn_summary use the script:
btn_summary.setCssClass('BUTTONP');<br>btn_detail.setCssClass('BUTTONG');<br>
This will change the background of the clicked button and the background of the other button
edit - ignore the <br> in the code examples
Thanks avsalynin for quick reply.
sap-custom-button is setting the default background color for the button
Hover: when the cursor goes there, it changes the color
Active: when you click on the button, it changes the color but I want to change the color of the button which is selected so I can have use multiple buttons as tabs.
Is there an option to change the color of the button which is selected? when i select the second button, previous selected button should go back to default color like we see in tabs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.