1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| itemmouseenter: function( view, record, item, rowIndex, e, eOpts ) {
// http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.tip.ToolTip
this.tip = Ext.create('Ext.tip.ToolTip', {
target : view.el, // The overall target element.
delegate : view.itemSelector, // Each grid row causes its own seperate show and hide.
trackMouse : true, // Moving within the row should not hide the tip.
renderTo : Ext.getBody(), // Render immediately so that tip.body can be referenced prior to the first show.
//showDelay : 2000,
listeners: { // Change content dynamically depending on which element triggered the show.
beforeshow: function updateTipBody(tip) {
tip.update('Please wait...');
Ext.Ajax.request({
url : 'data/item/read.php',
method : 'POST',
params: {
cid : PatentPulse.profileUser.get('cid'),
lid : PatentPulse.profileUser.get('id'),
json_id : record.get('id')
},
success : function(response){
// convert text response to javascript object
var res = Ext.JSON.decode(response.responseText);
// if server response contains "success" node, then success!
if ((res.success === true) && (res.total>0))
{
tip.update(res.data[0]["item"]);
} else
{
}
},
failure : function(response){
}
});
}
}
});
} |
Partager