Results 1 to 2 of 2

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

  1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    7
    Vote Rating
    0
      0  

    Default 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
    Answers
    64
    Vote Rating
    20
      -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.

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
  •