Results 1 to 5 of 5

Thread: List with checkbox

  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    19
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    Capture the change event on the checkbox elements
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    19
    Vote Rating
    0
      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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  5. #5
    Sencha User
    Join Date
    Apr 2012
    Posts
    19
    Vote Rating
    0
      0  

    Default

    Thanks a lot Mitchell for your reply...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •