Prashant0104
26 Sep 2012, 3:06 AM
Hi,
How can I add click handler for split button present in panel grid in Controller? On handler I want to know which rowIdex was clicked, and which menuitem of split button is clicked.
I am using Extjs 4.1
In grid panel I am using actioncolumn to show split button. Following is the code for that.
How can I add handler for split button in Controller? what will be the reference selector for split button menu in the controller, so that I can put click handler there.
columns: [
{
xtype: 'actioncolumn',
width:100,
renderer: function (v, m, rec) {
var id = Ext.id();
Ext.defer(function () {
Ext.create('Ext.button.Split', {
renderTo: id,
text: 'Action',
menu: new Ext.menu.Menu({
items: [
{ xtype: 'menuitem',text: 'View'},
{ xtype: 'menuitem',text: 'Edit',
handler: function(){
alert(" clicked on Edit");
me.viewSplitBtnClicked(rec);
}
},
]
})
});
}, 50);
return Ext.String.format('<div id="{0}"></div>', id);
}
}
]
How can I add click handler for split button present in panel grid in Controller? On handler I want to know which rowIdex was clicked, and which menuitem of split button is clicked.
I am using Extjs 4.1
In grid panel I am using actioncolumn to show split button. Following is the code for that.
How can I add handler for split button in Controller? what will be the reference selector for split button menu in the controller, so that I can put click handler there.
columns: [
{
xtype: 'actioncolumn',
width:100,
renderer: function (v, m, rec) {
var id = Ext.id();
Ext.defer(function () {
Ext.create('Ext.button.Split', {
renderTo: id,
text: 'Action',
menu: new Ext.menu.Menu({
items: [
{ xtype: 'menuitem',text: 'View'},
{ xtype: 'menuitem',text: 'Edit',
handler: function(){
alert(" clicked on Edit");
me.viewSplitBtnClicked(rec);
}
},
]
})
});
}, 50);
return Ext.String.format('<div id="{0}"></div>', id);
}
}
]