1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    9
    Vote Rating
    0
    Prakash23 is on a distinguished road

      0  

    Default Unanswered: Edit html of list item Template on list Item tap

    Unanswered: Edit html of list item Template on list Item tap


    Hello, i m using a list with following template -

    <input type="checkbox" name="selectedCar" value={name}/> {name}

    and I want to check the checkbox when the list item is tapped, but I m unable to achieve it, i tried with following code -

    onListItemTap: function(dataview, index, target, record, e, options) {
    target.select("input").set("checked","checked");
    }

    can somebody explain what I m doing wrong here...

  2. #2
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,361
    Answers
    102
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    Does target.select("input") actually result in a single input element?

    If so, have you tried el.checked = true?

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    9
    Vote Rating
    0
    Prakash23 is on a distinguished road

      0  

    Default got it Working

    got it Working


    yes, you are right, the select is returning an array of elements, I got it working with -

    target.select("input",e.target).set({checked:"checked"});

    now, as I defined the root element, I only get one element with select and is checked successfully.
    Last edited by Prakash23; 26 Sep 2012 at 4:56 AM. Reason: typo

  4. #4
    Sencha User
    Join Date
    Mar 2012
    Posts
    9
    Vote Rating
    0
    Prakash23 is on a distinguished road

      0  

    Default One more question...

    One more question...


    err, i m stuck again :S

    i m able to mark checkbox, but the issue is that this list is shown of a navigation view, so when user presses back , and if he comes back to this screen(list) again , then the item tap event is not firing, any idea why this is happening?

Thread Participants: 1