PDA

View Full Version : Tooltip on Mouse hover on listview and grid



amit.vankadia
4 Dec 2010, 10:42 PM
How can i display tooltip when i mousehover grid or listview based on the data which i have mouse hover.

sorry i spoke too early but ListViewEvent will give you Model when you add a listener for Events.OnMouseOver

so how can i create tooltip on cell or listview cell?

sven
5 Dec 2010, 5:53 AM
You can use quicktip for this. There is even an example how to add the extra needed markup: http://www.sencha.com/examples/explorer.html#basicgrid

http://www.sencha.com/examples/explorer.html#combobox (second combo, the list is a listview)

imsearcher
15 Jun 2011, 10:32 PM
Get the element of the grid cell and insert a quick tip into the element.:-?


QuickTip quickTip = new QuickTip(gridItemList);
gridItemList.addListener(Events.OnMouseOver,
new Listener<GridEvent<BeanModel>>() {

@Override
public void handleEvent(GridEvent<BeanModel> ge) {
com.google.gwt.dom.client.Element el = gridItemList
.getView().getCell(ge.getRowIndex(),
ge.getColIndex());
if (el != null) {
try {
String html = "<span qtip='"
+ el.getFirstChildElement()
.getInnerText()
+ "'>"
+ el.getFirstChildElement()
.getInnerHTML() + "</span>";
el.getFirstChildElement().setInnerHTML(html);
} catch (Exception e) {
}
}
}
});