1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    7
    Vote Rating
    0
    imcl is on a distinguished road

      0  

    Default Unanswered: How to concatenate an Ext.JS method inside a tpl string?

    Unanswered: How to concatenate an Ext.JS method inside a tpl string?


    I would like to use Ext's String method on some text that will be output to the view.


    For example:


    Code:
        itemTpl: [
            ...
            '<tpl switch="post_type">',
            '<tpl case="new_user">',
                '<p>{post_text_teaser}</p>',
                '<p>{timestamp}</p>',
            '<tpl default>',
                '<p>' + Ext.String.ellipsis( + '{post_text_teaser}' + \, 4) + '</p>',
            ...
        ].join(''),
    but of course the concatenation in line 10 is illegal.


    Do you know if it's possible or how to do this correctly?

  2. #2
    Sencha User
    Join Date
    Apr 2010
    Location
    China
    Posts
    227
    Vote Rating
    20
    Answers
    64
    haduki will become famous soon enough haduki will become famous soon enough

      -1  

    Default


    Code:
    
        itemTpl: [
            ...
            '<tpl switch="post_type">',
            '<tpl case="new_user">',
                '<p>{post_text_teaser}</p>',
                '<p>{timestamp}</p>',
            '<tpl default>',
                '<p>{[Ext.String.ellipsis(values.post_text_teaser,4)]}</p>',
            ...
        ].join(''),
    pls,get more info from ext doc.
    I write English by translator.

Thread Participants: 1

Tags for this Thread