1. #1
    Sencha User rabelanger's Avatar
    Join Date
    Jan 2010
    Location
    Montreal
    Posts
    15
    Vote Rating
    1
    rabelanger is on a distinguished road

      0  

    Default Unanswered: Best approach for image load event in XTemplate

    Unanswered: Best approach for image load event in XTemplate


    Hi,

    With the release of 2.1 and the new list, items height can either be variable of fix, which is greatly appreciated in terms of performance. The only problem I have is that in my xtemplate, I have images that may vary in height, which would require a refresh on the list in order to resize the item's height properly.

    What is the best approach to listen to load event of images? I don't want to iterate through the dom on the store load callback and add events on each item. I tried delegating to the the img tag and listen to load events, but its not working. Im guessing because their dom events and not fired by the component itself.

    Any help/indications would be appreciated.

    Thanks,
    rafael
    rafael

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,672
    Answers
    3354
    Vote Rating
    748
    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


    I believe there is a bug when rendering the rows with variable heights. By default the variableHeights config is set to true.
    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 rabelanger's Avatar
    Join Date
    Jan 2010
    Location
    Montreal
    Posts
    15
    Vote Rating
    1
    rabelanger is on a distinguished road

      0  

    Default


    I'm not sure if its a bug. I have images with variable heights. Using the src.sencha service, my images width are determined by the size of my screen, but the height may vary depending on the image.

    Not sure how the variableHeight is implemented, but will the list be refreshed to recalculate the items height when the images are loaded or will I have to refresh the list myself? I'm guessing the second one.

    If I were to have to listen to the load event of my images in the template in order to refresh the list manually, how can I use event delegation for the load event of the images. Doing the example below in my list won't work..

    Code:
     listeners : {
        load: {
            fn:'somefunction',
            delegate:'img'
        }
    }
    rafael

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar