ttbgwt
6 Aug 2012, 3:53 PM
how can I reference the call to myFunction correctly from within the mouseover event on the column renderer?
Ext.define('MYAPP.view.grid.Tags', {
extend: 'Ext.grid.Panel',
initComponent: function () {
var me = this;
var config = {
store: store,
columns: [
Ext.create('Ext.grid.RowNumberer', {
id: 'rowId',
width: 50,
header: 'Row'
}),
{
id: 'tag',
header: 'Tag',
dataIndex: 'tag',
renderer: function (value, metaData, record, rowIndex, colIndex, store, view) {
//how can I reference the call to myFunction correctly?
//also, is there a way to pass in the event object to myFunction on the span's mouseover event?
return '<span onmouseover="javascript:myFunction(' + value + ');">' + value + '</span>';
}
}
]
};
Ext.apply(me, config);
me.callParent(arguments);
},
myFunction: function (data, eventObj) {
var me = this;
if (!eventObj) var eventObj = window.event;
var relTarg = eventObj.relatedTarget || eventObj.fromElement;
}
});
Ext.define('MYAPP.view.grid.Tags', {
extend: 'Ext.grid.Panel',
initComponent: function () {
var me = this;
var config = {
store: store,
columns: [
Ext.create('Ext.grid.RowNumberer', {
id: 'rowId',
width: 50,
header: 'Row'
}),
{
id: 'tag',
header: 'Tag',
dataIndex: 'tag',
renderer: function (value, metaData, record, rowIndex, colIndex, store, view) {
//how can I reference the call to myFunction correctly?
//also, is there a way to pass in the event object to myFunction on the span's mouseover event?
return '<span onmouseover="javascript:myFunction(' + value + ');">' + value + '</span>';
}
}
]
};
Ext.apply(me, config);
me.callParent(arguments);
},
myFunction: function (data, eventObj) {
var me = this;
if (!eventObj) var eventObj = window.event;
var relTarg = eventObj.relatedTarget || eventObj.fromElement;
}
});