This is a migrated thread and some comments may be shown as answers.

Toggle Button from Button

6 Answers 565 Views
Button
This is a migrated thread and some comments may be shown as answers.
Dr.YSG
Top achievements
Rank 2
Dr.YSG asked on 05 Dec 2013, 05:46 PM
I am trying to create something similiar to the Kindle Download page: https://read.amazon.com/, It has two buttons at the top: [CLOUD] [DOWNLOADED]

Each button can be in either a selected or non-selected state. There is always one selected (so they work as a radio button pair).

The color of the button indicates whether it is selected or not.

I like the way your CSS (MetroBlack) displays the button for button.k-state-focused, but my guess is you use that automatically, so if I click somewhere else it would lose that decoration. 

Is there a way I can put decoration on the button and have it "sticky" until I click it's pair (I would implement the radio button state logic in javascript), unless there is a brilliant way to do this in css!




6 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 09 Dec 2013, 09:10 AM
Hello Yechezkal,

Since the Button currently does not provide toggle behavior, you can manually apply CSS classes or inline styles to achieve the same behavior. The widget's click event can help you.

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Sean
Top achievements
Rank 1
answered on 03 Jan 2014, 06:03 AM
Adding this functionality would be well received I'm sure. I've been looking around for a control to give my UI a yes/no toggle option and the button was my first thought.
Thanks,
Todd
0
Dimo
Telerik team
answered on 03 Jan 2014, 07:55 AM
Hello Todd,

You can vote for this feature at http://feedback.kendoui.com/

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Sean
Top achievements
Rank 1
answered on 03 Jan 2014, 01:53 PM
Thanks, I was able to find the Toggle Button vote: http://feedback.kendoui.com/forums/127393-kendo-ui-feedback/suggestions/2354861-toggle-style-buttons-ui-elements . I'm hoping 2014 brings the Kendo Web control sets up to par with the ASP.NET suite, as I've had some great experiences integrating the selection available.
Happy New Year,
Todd
0
Michele
Top achievements
Rank 2
answered on 03 Sep 2014, 06:50 AM
Hello Dimo, could you please indicate which classes are necessary to make the button looking like in the "pressed" or "toggle" state?
0
Dimo
Telerik team
answered on 03 Sep 2014, 08:12 AM
Hello Paolo,

You can use the k-state-active CSS class.

Regards,
Dimo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Button
Asked by
Dr.YSG
Top achievements
Rank 2
Answers by
Dimo
Telerik team
Sean
Top achievements
Rank 1
Michele
Top achievements
Rank 2
Share this question
or