ParamQuery grid support forum
General Category => Help for ParamQuery Grid (free version) => Topic started by: glt on October 05, 2018, 06:36:55 am
-
Hi PQ,
In the render function for a column, I need code that will show a jQuery dialog on cell mouseover.
I have this (doesn't work due to promoToolTip() function being out of scope):
render: function ( ui ) {
var oRowData = ui.rowData;
var oDataIdx = ui.dataIndx;
var strEmpCode = oRowData["EmpCode"];
var strCellValue = "";
if (oRowData[oDataIdx] == "Merit Promotion") {
strCellValue = "<a href=\"#\" onmouseover=\"promoToolTip('" + strEmpCode + "');\" onclick=\"return false;\">Merit Promotion</a>";
}
else
strCellValue = "Merit Promotion";
return strCellValue;
}
Instead I need to bind the call to promoToolTip to the cell's mouseover event using jQuery.
How do I do that?
Cheers,
Geoff
-
No idea of promoToolTip
jQuery tooltip is bound to whole cells by adding title attribute to cells as in this example:
https://paramquery.com/demos/comments
-
Hi
Thanks for the response.
promoToolTip is my own function that builds the content of the dialog.
It receives strEmpCode and builds the content based on that value.
How to call a custom function in this way from a comment?
Cheers
Geoff
-
Hi PQ,
I made a jsfiddle to illustrate what I am trying to do:
https://jsfiddle.net/glt101/xpvt214o/872647/
Let me know if I can clarify this further.
Cheers,
Geoff
-
Your code is fine conceptually except 2 issues.
editAccount function needs to be in window scope and strID value should be passed.
https://jsfiddle.net/anh2L5pc/
-
Thanks PQ.
That was exactly what I needed. :D
Cheers,
Geoff