-
9 Nov 2012 6:22 AM #1
Unanswered: List with checkbox
Unanswered: List with checkbox
Hi all,
I am a newbie in Sencha and working on a demo application. I want to show list with checkbox i.e with each list item there would be a checkbox and when user check it that particular list item's text color will be changed and vice versa...
Below is the code snippet :
{
xtype: 'list',
id: 'noteslist',
itemTpl: '<input type="checkbox" class="todo_checkbox " >'
<span class="note">{note_text}</span>'
store: 'Notes',
listeners: {
itemtap: function(view, index, target, record, event) {
}
}
When user check a checkbox corresponding list item's text color will be changed and when uncheck, it will back to normal. How to do so???
Please Help me regarding this...
-
12 Nov 2012 8:02 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,637
- Vote Rating
- 435
- Answers
- 3106
Capture the change event on the checkbox elements
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.
-
13 Nov 2012 10:41 PM #3
Thanks Mitchell for your reply but I am not sure how to "Capture the change event on the checkbox elements"....Can you please explain it little bit more???
-
14 Nov 2012 5:35 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,637
- Vote Rating
- 435
- Answers
- 3106
I haven't tested that but it should listen for the change event on the <input type='checkbox' />Code:listeners : { element : 'element', delegate : 'input[type=checkbox]', change : function() {} }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.
-
15 Nov 2012 9:32 PM #5


Reply With Quote