Hybrid View
-
4 Nov 2011 2:22 PM #1Sencha Premium Member
- Join Date
- May 2008
- Location
- Pasadena, California
- Posts
- 172
- Vote Rating
- 1
- Answers
- 27
Answered: checkbox renderTpl
Answered: checkbox renderTpl
Hello,
I was altering the checkbox to appear more like a natural checkbox in sencha touch 1.1 by adding this to checkbox config
this no longer works in 2.0. Can you advise as to what I can do in 2.0 to style the checkbox?Code:baseCls: 'x-plain', renderTpl: [ '<tpl if="fieldEl"><input id="{inputId}" type="{inputType}" name="{name}" class="{fieldCls}" tabIndex="-1" ', '<tpl if="checked"> checked </tpl>', ' value="{inputValue}"> {label}</input>', '</tpl>' ],
thanks
-
Best Answer Posted by rdougan
The underlying HTML for the component actually uses a <input type="checkbox" /> tag.
The main CSS override you will need is below. However there are many other things you will need to add to make it look 'correct' in all devices.
Code:.x-input-checkbox { -webkit-appearance: checkbox; }
-
5 Nov 2011 6:40 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 436
- Answers
- 3113
It's done via CSS. Inspect it and start enabling/disabling things.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
5 Nov 2011 8:37 PM #3
The underlying HTML for the component actually uses a <input type="checkbox" /> tag.
The main CSS override you will need is below. However there are many other things you will need to add to make it look 'correct' in all devices.
Code:.x-input-checkbox { -webkit-appearance: checkbox; }


Reply With Quote