Monday 23 September 2013

Extjs, use function in tpl , in gridPanel's templateColumn

 {
           header: '',
           xtype: 'templatecolumn',
           tpl: ['<div>' +
                    '<div>' +
                        '<tpl for="data">' +
                            '<tpl if="Title.length &gt; 0">'+
                                '<div>{Title}</div>' +
                            '</tpl>' +
                            '<div>{[this.shorten(values.fullName)]}</div>' +
                        '</tpl>' +
                    '</div>'
                   , {
                    shorten: function (noOfTimes) {

                        return noOfTimes;
                    }
                }], 
       },

That's how we can use functions in tpl.




No comments:

Post a Comment