1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    16
    Vote Rating
    0
    stephensaw is on a distinguished road

      0  

    Default Automatic deselect when select other item

    Automatic deselect when select other item


    Hi,

    I'm trying to modify the Dataview to add in some custom dom when calling applyItemTpl, I manage to get that working, when I select on the list item, I will add some CSS and do some stuff on the new dom, and when other list item selected, I want to 'deselect' the previous one by removing the CSS.

    I've studied the Dataview.js source, since it wil remove the x-item-selected class for not selected item, but I'm kinda lost when trying to figure out how and where the code remove the x-item-selected class from previously selected list item and assigned it to the newly selected list item.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,714
    Vote Rating
    438
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    It gets removed in the doItemDeselect method or you can use events
    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.