1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    19
    Vote Rating
    0
    Andy Lincoln is on a distinguished road

      0  

    Default 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...

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,548
    Vote Rating
    872
    Answers
    3566
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Capture the change event on the checkbox elements
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    19
    Vote Rating
    0
    Andy Lincoln is on a distinguished road

      0  

    Default


    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???

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,548
    Vote Rating
    872
    Answers
    3566
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Code:
    listeners : {
        element : 'element',
        delegate : 'input[type=checkbox]',
        change : function() {}
    }
    I haven't tested that but it should listen for the change event on the <input type='checkbox' />
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Sencha User
    Join Date
    Apr 2012
    Posts
    19
    Vote Rating
    0
    Andy Lincoln is on a distinguished road

      0  

    Default


    Thanks a lot Mitchell for your reply...

Thread Participants: 1