I have a simple spreadsheet grid (example), and each cell has a tooltip... I'm using meta.tdAttr to add the tooltip for each cell. In Chrome, after the tooltip is shown, when I start dragging diagonally from the top left cell, the tooltip gets in the way and eventually has its text selected. I'm not sure if this is a bug or if it's just browser behavior (as IE and FF don't produce this issue, but do produce a little bit of lag in selecting). Either way, it's definitely a very annoying issue... it's not as prevalent in this example as it is in my actual application, but hopefully you get the idea.
Ideally, I'd listen to the mousedown event, and disable showing of tooltips, as mousedown would indicate a selection is about to occur. Then when mouseup is fired, I can enable showing of tooltips on hover.
I saw several examples from v4.2 and older, but they no longer apply to v5.0+. I started off using this example to make a cell tooltip, but it's a little difficult if I don't know the column/row index. This led me to this example, which uses the view's uievent to store the hovered row and column index. However, this doesn't appear to get updated on each cell hover in v4.2.1+. In v4.2.0, it worked fantastically.
Is there a way to create the tooltip on mouseover of the cell, and also have access to the row and column index of that cell?
Ext.application({
name: 'Fiddle',
launch: function() {
Ext.create('Ext.data.Store', {
storeId: 'simpsonsStore',
fields: ['name', 'email', 'phone'],
data: {
'items': [{
'name': 'Lisa',
"email": "[email protected]",
"phone": "555-111-1224"
}, {
'name': 'Bart',
"email": "[email protected]",
"phone": "555-222-1234"
}, {
'name': 'Homer',
"email": "[email protected]",
"phone": "555-222-1244"
}, {
'name': 'Marge',
"email": "[email protected]",
"phone": "555-222-1254"
}, {
'name': 'Lisa',
"email": "[email protected]",
"phone": "555-111-1224"
}, {
'name': 'Bart',
"email": "[email protected]",
"phone": "555-222-1234"
}, {
'name': 'Homer',
"email": "[email protected]",
"phone": "555-222-1244"
}, {
'name': 'Marge',
"email": "[email protected]",
"phone": "555-222-1254"
}, {
'name': 'Lisa',
"email": "[email protected]",
"phone": "555-111-1224"
}, {
'name': 'Bart',
"email": "[email protected]",
"phone": "555-222-1234"
}, {
'name': 'Homer',
"email": "[email protected]",
"phone": "555-222-1244"
}, {
'name': 'Marge',
"email": "[email protected]",
"phone": "555-222-1254"
}, {
'name': 'Lisa',
"email": "[email protected]",
"phone": "555-111-1224"
}, {
'name': 'Bart',
"email": "[email protected]",
"phone": "555-222-1234"
}, {
'name': 'Homer',
"email": "[email protected]",
"phone": "555-222-1244"
}, {
'name': 'Marge',
"email": "[email protected]",
"phone": "555-222-1254"
}, {
'name': 'Lisa',
"email": "[email protected]",
"phone": "555-111-1224"
}, {
'name': 'Bart',
"email": "[email protected]",
"phone": "555-222-1234"
}, {
'name': 'Homer',
"email": "[email protected]",
"phone": "555-222-1244"
}, {
'name': 'Marge',
"email": "[email protected]",
"phone": "555-222-1254"
}]
},
proxy: {
type: 'memory',
reader: {
type: 'json',
rootProperty: 'items'
}
}
});
function columnRenderer(value, meta) {
meta.tdAttr = 'data-qtip="This is<br />some really<br />long tooltip, so I hope you do not mind reading it"';
return value;
}
Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [{
text: 'Name',
dataIndex: 'name',
renderer: columnRenderer
}, {
text: 'Email',
dataIndex: 'email',
flex: 1,
renderer: columnRenderer
}, {
text: 'Phone',
dataIndex: 'phone',
renderer: columnRenderer
}],
selModel: {
type: 'spreadsheet'
},
height: 800,
width: 800,
renderTo: Ext.getBody()
});
}
});