PDA

View Full Version : Grid Row Tip



ljqsky
15 Jul 2009, 6:34 PM
//----mouseover??
grid.addListener('mouseover', function(e){
//----get event obj
e.preventDefault();
var target = e.getTarget();

//----get rowIndex
var rowIndex = grid.getView().findRowIndex(target);

//----'boolean' or 'number'
if(typeof(rowIndex)!='boolean'){
var store = grid.getStore();
var data = store.getAt(rowIndex).data;

var str = "";
str += "<table class='tip_table'>";
str += " <tr><td class='tip_title'>title1</td><td class='tip_data'>" + data.cell1+ "</td></tr>";
str += " <tr><td class='tip_title'>title2</td><td class='tip_data'>" + data.cell2+ "</td></tr>";
str += "</table>";

Tip(str); //----this is my javascript function.
}
});

^_^