jeudi 20 novembre 2014

Ext JS 4 - How to Hide ToolTip on MouseOut of target and tooltip box ?

I am using Ext JS 4.2 and using 'ToolTip' class to create new tooltip , In my project I want to assign tooltip to particular column of grid and in that column I am rendering custom HTML, so same css class can be present at more than one place.


Issue I am facing is on mouse out of custom HTML tooltip is not hidden , similarly on mouse out of tooltip area tooltip box is not hidden. Please help.



Code:



var myAppStore = Ext.create('Ext.data.Store',
{
autoLoad: true,
storeId: 'myappstore',
fields: ['name', 'email', 'phone'],
proxy: {
type: 'memory',
data: {
"items": [
{
'name': 'LisaABCDefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
"email": "lisa@simpsons.com",
"phone": "555-111-1224",
"Address":'true',
}, {
'name': 'Bart',
"email": "bart@simpsons.com",
"phone": "555-222-1234",
"Address":'true',
}, {
'name': 'Homer',
"email": "home@simpsons.com",
"phone": "555-222-1244",
"Address":'true',
}, {
'name': 'Marge',
"email": "marge@simpsons.com",
"phone": "555-222-1254",
"Address":'true',
}
]
},
reader: {
type: 'json',
root: 'items'
}
}
});
var panel = Ext.create('Ext.grid.Panel',{
store: myAppStore,
renderTo: Ext.get('myPanel'),
columns: [{
text: 'Name',
dataIndex: 'name',
menuDisabled : true,
flex:1,
} ,{
text: 'Email',
dataIndex: 'email',
flex: 1
}, {
text: 'Phone',
dataIndex: 'phone',
renderer : function(value, meta, record, rowIndex, colIndex){
return this.phoneTpl.apply({
value : value
});
}

},
{
header: 'Email',
dataIndex: 'email',
flex:1,
editor: {
xtype: 'textfield',
allowBlank: false
},
renderer : function(value, meta, record, rowIndex, colIndex) {
var store = Ext.getStore('MyAppStore');
var record = store.getAt(rowIndex);
var newValue = record.get('name') + ',' + record.get('phone');
return newValue;
}
},
],
phoneTpl: new Ext.XTemplate(
'<div class="dummyclass" style="text-align:center;">{value}</div>'
),
listeners: {
render : function(view,op) {
console.log('onGridRender');
view.tip = Ext.create('Ext.tip.ToolTip', {
target: view.el,
delegate: '.dummyclass div',
title: 'Here Comes Title',
autoHide : true,
showDelay: 750,
hideDelay: 60000,
dismissDelay: 0,
minWidth: 150,
mouseOffset: [-10, -10],
anchorOffset: 110,
closable : true,
renderTo: Ext.getBody(),
listeners: {
beforeshow: function updateTipBody(tip) {
tip.update('Content will come here');
},
}
});
}
},
});
panel.show();





Ext JS 4 - How to Hide ToolTip on MouseOut of target and tooltip box ?

Aucun commentaire:

Enregistrer un commentaire