I am formatting some tooltips in my datagrid
and everything works great until I go to the next page using an Ajax call. Here is the basic code I am using. I think I should use "on", but several attempts haven't worked well. I'm assuming that this is a basic jQuery answer, but I can post the Ajax paging code too if necessary.
<script type='text/javascript' src='http://code.jquery.com/jquery-1.9.1.js'></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css">
<link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<style type='text/css'>
.ui-tooltip {
padding: 10px 20px;
border-radius: 20px;
font: bold 14px"Helvetica Neue", Sans-Serif;
font-size: 0.75em;
box-shadow: 0 0 7px black;
width:210px;
z-index:1000;
}
.ui-tooltip.PE {
color: #000000;
background: #E680B2 !important;
}
.ui-tooltip.PC {
color: #000000;
background: #B2D1FF;
}
.ui-tooltip.PU {
color: #000000;
background: #7A0099;
}
</style>
<script type='text/javascript'> //<![CDATA[
$(function() {
$('td.tips').each(function() {
var style = $(this).data('info');
$(this).tooltip({
content: function() {
return '<em>' + $(this).attr('title') + '</em>';
},
tooltipClass: style,
show: "slideDown",
open: function(event, ui) {
ui.tooltip.hover(function() {
$(this).fadeTo("slow", 0.5);
});
}
});
});
}); //]]>
</script>
The HTML would be something like this:
<table border="1">
<tr>
<td title="(Incomplete P/N, Wrong P/N, Invalid P/N, etc...)" data-info="PC" class="tips"><span id="grdNoGoods_ctl12_lblBuyerComments">10/16/2014 - Req to be cancelled per PC</span></td>
<td title="test1" class="tips" data-info="PE">John Black</td>
<td title="test2" class="tips" data-info="PU">John Black</td>
</tr>
<tr>
<td colspan="3">
<table border="0">
<tr>
<td><b>Page Size: </b><select name="grdNoGoods$ctl15$ctl01" onchange="javascript:setTimeout('__doPostBack(\'grdNoGoods$ctl15$ctl01\',\'\')', 0)">
<option selected="selected" value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="75">75</option>
<option value="100">100</option>
<option value="150">150</option>
<option value="200">200</option>
</select></td><td><span>1</span></td><td><a href="javascript:__doPostBack('grdNoGoods','Page$2')">2</a></td><td><a href="javascript:__doPostBack('grdNoGoods','Page$3')">3</a></td><td><a href="javascript:__doPostBack('grdNoGoods','Page$4')">4</a></td><td><a href="javascript:__doPostBack('grdNoGoods','Page$5')">5</a></td><td><a href="javascript:__doPostBack('grdNoGoods','Page$6')">6</a></td><td><a href="javascript:__doPostBack('grdNoGoods','Page$7')">7</a></td><td><a href="javascript:__doPostBack('grdNoGoods','Page$8')">8</a></td><td><a href="javascript:__doPostBack('grdNoGoods','Page$9')">9</a></td>
</tr>
</table>
</tr>
</table>