Can I select somehow the Header itself from a Ext.grid.feature.Grouping?
thx,
Zol
Printable View
Can I select somehow the Header itself from a Ext.grid.feature.Grouping?
thx,
Zol
this will drive me crazy ;) Still no luck.
Code what does not find a method by on click:
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.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: [ ... ]
... }
Templates can handle functions by docs: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.XTemplate
thanks guysCode:
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);
updated code. First console echo works. Second try to fire group select is even not called back.
any idea?Code:features: [ Ext.create('Ext.grid.feature.Grouping',{
groupHeaderTpl:
Ext.create('Ext.XTemplate',
' {[this.groupSelect()]}: <input type="button" onclick="this.groupSelect()" value="select"> {name} ',
{
groupSelect: function(value) { TpsApp.console('tpl grp sel: '+value); }
}
),
thanks