this will drive me crazy
Still no luck.
Code what does not find a method by on click:
Code:
items: {
xtype: 'grid',
itemId: 'searchGrid',
selModel: Ext.create('Ext.selection.RowModel', { listeners: { select: {fn: me.rowSelect, scope: me } } }),
features: [ Ext.create('Ext.grid.feature.Grouping',{
groupHeaderTpl: ' <input type="button" onclick="groupSelect" value="select"> {name} ',
startCollapsed: false,
enableGroupingMenu: false,
collapsible: false,
fn: {
groupSelect: function(value) {
console.log('grp sel: '+value);
}
}
})],
columns: [ ... ]
... }
Does anybody know how to define any method, what can be called back from a template element? I have already try this. or parent. or Ext.ComponentQuery.query('#an-id')[0] but nothing else execute, just a pure method name.
Templates can handle functions by docs: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.XTemplate
Code:
var tpl =newExt.XTemplate('<p>Name: {name}</p>','<p>Kids: ','<tpl for="kids">','<tpl if="this.isGirl(name)">','<p>Girl: {name} - {age}</p>','</tpl>',// use opposite if statement to simulate 'else' processing:'<tpl if="this.isGirl(name) == false">','<p>Boy: {name} - {age}</p>','</tpl>','<tpl if="this.isBaby(age)">','<p>{name} is a baby!</p>','</tpl>','</tpl></p>',{// XTemplate configuration: disableFormats:true,// member functions: isGirl:function(name){return name =='Sara Grace';}, isBaby:function(age){return age <1;}});tpl.overwrite(panel.body, data);
thanks guys