我必须使用title=Click to select row
右侧的工作台上的工具提示。
我需要在该行级别打开工具提示并从该行获取。稍后我会将这些值传递给ajax调用,从调用show中获取其他值。
<table class="grid" cellspacing="0" rules="all" border="1" id="Body_grdLoan" style="background-color:LightGrey;width:100%;border-collapse:collapse;">
<tr title="Click to select row" class="gridItem">
<td style="white-space:nowrap;">121253767</td>
<td style="white-space:nowrap;">BALTA 2006-6</td>
<td>3</td>
<td> <input type="image" name="ctl00$Body$grdLoan$ctl02$imgPDF" id="Body_grdLoan_imgPDF_0" src="Images/pdf.png">
</td><td style="display:none;">BALTA_2006_6_0000857482</td><td style="display:none;">1</td>
</tr>
<tr title="Click to select row" class="gridAltItem">
<td style="white-space:nowrap;">153767880</td><td style="white-space:nowrap;">CWHEL 2007-A</td>
<td>2</td>
<td> <input type="image" name="ctl00$Body$grdLoan$ctl03$imgPDF" id="Body_grdLoan_imgPDF_1" src="Images/pdf.png">
</td>
<td style="display:none;">CWHEL_2007_A_0000287130</td><td style="display:none;">1</td>
</tr>
<tr class="gridItem" onmouseover="" onmouseout="" onclick="">
<td style="white-space:nowrap;"> </td>
<td style="white-space:nowrap;"> </td>
<td></td><td></td><td style="display:none;"> </td><td
style="display:none;">0</td>
</tr>
<tr class="gridAltItem" onmouseover="" onmouseout="" onclick="">
<td style="white-space:nowrap;"> </td>
<td style="white-space:nowrap;"> </td>
<td></td><td></td><td style="display:none;"> </td>
<td style="display:none;">0</td>
</tr>
我有以下示例,但我不明白如何在上表中使用它? Jquery大师帮助我。
$("table[id*=Body_grdLoan] --use my row--").tooltip({
delay: 0,
offset: [-65, -110],
position: 'center top',
bodyHandler: function() {
var VendorID = $(this).closest("tr").find("--find first TD value --").text();
var ItemID = $(this).closest("tr").find("--find second TD value--").val();
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "Default.aspx/getLastRequest",
data: "{'VendorID': '" + VendorID + "','ItemID': '" + ItemID + "'}",
dataType: "json",
success: function(msg) {
$("#loadingimage").parent().html(msg.d);
}
});
return $("<img id='loadingimage' src='http://www.heathrowtosouthampton.co.uk/Web/images/gif/Processing1.gif' />");
}
});