parky128
2 Dec 2011, 8:00 AM
Hi,
Is it possible to get a reference to the application instance from a member function of an XTemplate in a view config? Sorry, thats quite a mouthful there! Here is some code:
Ext.define('PinpointersTouch.view.UnitList', {
extend: 'Ext.List',
xtype: 'unitslist',
config: {
fullscreen: true,
itemTpl: new Ext.XTemplate(
'<ul id="unitList">',
'<tpl for=".">',
'<li>',
'<table width="100%" cellspacing="0">',
'<tr>',
'<td style="width:30px; text-align:center">{[this.getUnitIcon(values.id)]}</td>',
'<td valign="middle"> - {UnitName}</td>',
'</tr>',
'</table>',
'</li>',
'</tpl>',
'</ul>',
{
getUnitIcon: function(untID) {
//var iconNum = this.application.getTrackingListStore().getById(untID).data.MapIcon;
//TO Do: Can I get a reference to the application instance from in here???
}
}),
store: 'CurrentGrid'
}
});
I need to look up some values in another store in my application based on a value being passed into the XTemplate member function.
Is it possible to get a reference to the application instance from a member function of an XTemplate in a view config? Sorry, thats quite a mouthful there! Here is some code:
Ext.define('PinpointersTouch.view.UnitList', {
extend: 'Ext.List',
xtype: 'unitslist',
config: {
fullscreen: true,
itemTpl: new Ext.XTemplate(
'<ul id="unitList">',
'<tpl for=".">',
'<li>',
'<table width="100%" cellspacing="0">',
'<tr>',
'<td style="width:30px; text-align:center">{[this.getUnitIcon(values.id)]}</td>',
'<td valign="middle"> - {UnitName}</td>',
'</tr>',
'</table>',
'</li>',
'</tpl>',
'</ul>',
{
getUnitIcon: function(untID) {
//var iconNum = this.application.getTrackingListStore().getById(untID).data.MapIcon;
//TO Do: Can I get a reference to the application instance from in here???
}
}),
store: 'CurrentGrid'
}
});
I need to look up some values in another store in my application based on a value being passed into the XTemplate member function.