View Full Version : How to use variable in tpl ?

27 Mar 2012, 5:42 AM
How can we use a variable value in tpl (of Ext.view.View) which is not coming from store?

27 Mar 2012, 10:43 AM
Ext.view.View needs a store to apply the data to the tpl.

27 Mar 2012, 10:55 AM
I have used store also but the case is that some of the data come from store and some I want to provide from variable. For example, here I want to give src of img from a variable but I don't know how can I specify variable inside tpl?

var a = Ext.create('Ext.view.View', {
store: mystore,
tpl: ['<tpl for=".">',
'<div class="Thumb"> <img vspace="5" src="'+ imagepath+ '" title="{name}"><p>{image}</p></div>',
'</tpl>', ],
and so onů