Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    12
    Vote Rating
    -1
    ChriZ is an unknown quantity at this point

      0  

    Default setStyle or appendStyles stops working after the element gets deleted and readded...

    setStyle or appendStyles stops working after the element gets deleted and readded...

    Sencha Touch version tested:
    • Sencha Touch 2.1.1
    Browser versions tested against:
    • newest Chrome
    Description:
    • I filled a list with items... added them with this.getList().setData(data).
      when i click a list item i change the CSS property (background-position) of an image to display another part of the imagestrip.
      i use Ext.get('listtreeitemimage' + id).applyStyles({'background-position': '0 0'}); or
      Ext.get('listtreeitemimage' + id).setStyle({'background-position': '0 0'});.
      that works fine... but when do a this.getList().getStore().removeAll()...
      and add new items the setStyle or applyStyles function wont change anything...
      the Ext.get(object) returns an object and no error comes up in the log.
    Steps to reproduce the problem:
    • Create a ListView
    • Add items to the list with this.getList().setData(data);
    • Change the Style of an Image from an List Item (inside itemTpl) <-- WORKS
      (eg. Ext.get('listtreeitemimage' + id).applyStyles({'background-position': '0 0'}); or
      Ext.get('listtreeitemimage' + id).setStyle({'background-position': '0 0'})
    • Clear the Store with this.getList().getStore().removeAll();
    • Add again items to the list with this.getList().setData(data);
    • Try to change the Style of an Image from an List Item (inside itemTpl) <-- DONT WORK
      (eg. Ext.get('listtreeitemimage' + id).applyStyles({'background-position': '0 0'}); or
      Ext.get('listtreeitemimage' + id).setStyle({'background-position': '0 0'})
    • So... setStyle or applyStyles stops working after i cleared the item once from the store and reinsert it...
    The result that was expected:
    • the style of the image should change
    The result that occurs instead:
    • the style of the image can only be changed once after the item gets deleted and inserted again
    Operating System:
    • Win7 Pro

    sorry for my bad english and thanks for you help

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    38,378
    Vote Rating
    1092
    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

      1  

    Default

    This is due to a caching system we use internally that we are looking at issues like this.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Software Engineer
    ________________
    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
    Feb 2012
    Posts
    12
    Vote Rating
    -1
    ChriZ is an unknown quantity at this point

      0  

    Default

    okay thanks
    is there any thing i can do that it works aftere a remove and reinsert,
    without using jquery (with it, it works)?

Thread Participants: 1