Help us understand the problem. What is going on with this article?

XTemplate で、長い文字を途中で切って表示する

More than 5 years have passed since last update.

テンプレート内では ellipsis メソッドが使える
例えば表示用データの description 項目を20文字で削って…をつける場合

view/HogeView.coffee
###
List view of some content
###
Ext.define "MyApp.view.HogeView",
  extend: "Ext.List"
  config:
    itemTpl:['ユーザ名:{login_id}さん:',
              '{description:ellipsis(20,false)}'].join('')
hal_sk
Georepublic Japan CEO http://georepublic.co.jp/, Code for Japan 代表理事 http://code4japan.org/, Detailed profile: http://jp.linkedin.com/in/halsk/ お仕事の依頼は info@georepublic.co.jp までお願いします。
http://www.georepublic.co.jp
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away