-
18 Feb 2012 5:53 PM #1
Answered: check method & event
Answered: check method & event
check/uncheck method triggers appropriate events in ST1.1, but it is not like that in ST2.0. How to have that in ST2.0 code?
-
Best Answer Posted by mitchellsimoens
It's not needed. To change the check status, it simple toggles the dom.checked field:
Code:onMaskTap: function(component, e) { var me = this, dom = component.input.dom; if (me.getDisabled()) { return false; } //we must manually update the input dom with the new checked value dom.checked = !dom.checked; //continue as normal, like a normal tap // this.onTap(component, e); //calling getchecked will sync the new checked value if (me.getChecked()) { me.fireEvent('check', me, e); } else { me.fireEvent('uncheck', me, e); } //return false so the mask does not disappear return false; },
-
19 Feb 2012 7:34 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
- Answers
- 3109
What do you mean? When you check a checkbox or radio field, the check event is fired. When you uncheck it, the uncheck event is fired.
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.
-
19 Feb 2012 7:40 AM #3
-
19 Feb 2012 7:41 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
- Answers
- 3109
Ok, that's how Sencha Touch 2 works.
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.
-
19 Feb 2012 7:45 AM #5
sorry, mean not that but calling check()/uncheck() methods
-
19 Feb 2012 7:47 AM #6Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
- Answers
- 3109
It's not needed. To change the check status, it simple toggles the dom.checked field:
Code:onMaskTap: function(component, e) { var me = this, dom = component.input.dom; if (me.getDisabled()) { return false; } //we must manually update the input dom with the new checked value dom.checked = !dom.checked; //continue as normal, like a normal tap // this.onTap(component, e); //calling getchecked will sync the new checked value if (me.getChecked()) { me.fireEvent('check', me, e); } else { me.fireEvent('uncheck', me, e); } //return false so the mask does not disappear return false; },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.


Reply With Quote