-
13 Sep 2010 8:56 PM #1
On/Off toggle buttom
On/Off toggle buttom
Hi,
A small tweak in css gave me usual Toggle Button that we used to see in Iphone
Example
CssCode:{ xtype: 'toggle', name: 'single_toggle', value : 1 }
Code:.x-field-toggle .x-slider { -webkit-border-radius: 0em; -webkit-box-shadow: inset rgba(0, 0, 0, 0) 0 0 0; } .x-field-toggle .x-slider .x-field-thumb:after { position: absolute; width: 2.5em; height: 2.5em; top: 0; left: 0; -webkit-box-shadow: rgba(0, 0, 0, 0) 0 0 0em; -webkit-border-radius: 0em; -webkit-transform: scale(0); border: none; background:none; overflow: visible; z-index: 2; } .x-field-toggle .x-slider.x-toggle-on { -webkit-appearance: none; background: url(checkbox_on.png); width: 94px; height: 27px; border: 0; float: left; margin: 8px 4px 0 5px; } .x-field-toggle .x-slider.x-toggle-off { -webkit-appearance: none; background: url(checkbox_off.png); width: 94px; height: 27px; border: 0; float: left; margin: 8px 4px 0 5px; }
-
14 Sep 2010 4:56 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
Is this a question? I'm confused.

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
14 Sep 2010 10:52 AM #3
tomalex0 is showing some custom styling to get iPhone style toggles.
Aaron Conran
@aconran
Sencha Architect Development Team
-
14 Sep 2010 10:59 AM #4Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
Cool. Moved to examples/showcases.
Should we offer an extensions forum?
Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
14 Sep 2010 2:18 PM #5
-
12 Jan 2011 9:53 AM #6
Modified css compatible with 1.01a version
Code:.x-field-toggle .x-slider { -webkit-border-radius: 0em; width:5.6em; height:1.6em; border: 0; } .x-field-toggle .x-slider.x-toggle-on { background: url(checkbox_on.png) no-repeat; } .x-field-toggle .x-slider.x-toggle-off { background: url(checkbox_off.png) no-repeat; } .x-field-toggle .x-thumb::before{ -webkit-box-shadow:none; background-color:transparent; border:none; background-image:none; }
-
12 Jan 2011 10:59 AM #7
Really nice tweak tomalex.
For Sencha team: Yes please activate a Sencha Ux forum, I was wondering if this was possible in a thread I open some weeks ago.
http://www.sencha.com/forum/showthre...-forum-sectionSencha Inc
Andrea Cammarata, Solutions Engineer
CEO at SIMACS
@AndreaCammarata
www.andreacammarata.com
github: https://github.com/AndreaCammarata
-
5 Apr 2011 1:56 AM #8Sencha User
- Join Date
- Sep 2010
- Location
- Lausanne / Switzerland - French Part
- Posts
- 2
- Vote Rating
- 0
little refactoring on tomalex0 sample code
little refactoring on tomalex0 sample code
just a little message to indicate that :
xtype: 'toggle', line code, must be replace with this one :
xtype: 'togglefield',
And with this modification, it will work great with senchaTouch 1.1
-
23 Jun 2011 5:46 AM #9
is there a way where you could use the css3-background-gradients and adding a transparent PNG with the button state titles? maybe by adding one more <span>-tag to the togglefield?
-
19 Jul 2011 6:30 AM #10
Simple but nice tweak
Simple but nice tweak
Thanks for publishing, works great.
It's just what i was looking for.
Thanks a lot.
Similar Threads
-
Autoload Refresh when Click the Buttom
By footballermahesh in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 8 Oct 2009, 7:28 PM -
(SOLVED) scroll dataview automatically to the buttom
By robin30 in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 21 Feb 2009, 3:06 PM -
in layout column to put button to buttom
By emredagli in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 6 Aug 2008, 2:35 AM -
add tab from a link or a buttom
By simpaulguy in forum Ext 1.x: Help & DiscussionReplies: 1Last Post: 29 Dec 2006, 11:37 AM


Reply With Quote