Results 1 to 3 of 3

Thread: Use of a function in XTemplate make app NOT work on iOS and some Android. Why?

  1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    62

    Default Use of a function in XTemplate make app NOT work on iOS and some Android. Why?

    Hi,

    I am having a hard time understanding why is this code working on SOME Android devices BUT no iOS except iPad. Enought talk, some code
    Code:
    var homelisting = new Ext.XTemplate(
        '<tpl for".">',
            '<div class="{class}">',
                '<img class="gameIcon" src="{thumbnail}" alt="{title}" />',
                
                '<div class="short_desc">{[Ext.util.Format.ellipsis(values.description, this.descriptionLength(values.class))]}</div>', 
    
    /*The descriptionLength function above is declared below but when i hide this line (above) my application works on all devices otherwise it's not the case as stated before. */
            
            '</div>',
        '</tpl>',
        {
            descriptionLength: function(myClass) {
                if (myClass == "gold") {
                    return 110;
                } else {
                    return 87;
                }
            }
        }
    );
    Thank you!
    Last edited by slmd; 12 Oct 2011 at 6:41 AM. Reason: visibility

  2. #2
    Sencha User
    Join Date
    Aug 2011
    Posts
    62

    Default

    Can someone tell me another way to rewrite this code mentionned abode please?
    Thank you!

  3. #3
    Sencha User
    Join Date
    Aug 2011
    Posts
    62

    Default

    I found out it was due to the fact i was using the reserved javascript word "{class}" in order to call the classname i set from the JSON. I renamed it and it's now working perfect on every device.

Tags for this Thread

Posting Permissions

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