簡體   English   中英

使用工具提示顯示表的行詳細信息(jQuery)

[英]using Tooltip to show a Row details of a Table (jQuery)

我能夠以表格格式在jsp頁面中顯示動態值。我想實現mouseover / hover函數(在jQuery中)以顯示我的表中的每一行詳細信息(在jsp頁面中)。我正在共享一些代碼在這里:

<table name="table" id="table" class="table" cellpadding="4" cellspacing="2" border="1" bgcolor="" >
<tr>
<th><input type="checkbox" name="allCheck" onclick="selectallMe()"></th>
<th>Emp ID</th>
<th>Emp Name</th>
</tr>
<tr class="tr" id="tr">
<%while(rs.next()){ %>
<td><input type="checkbox" name="chkName" onclick="selectall()"></td> 
<td><input type="text"  name="empId" value="<%= rs.getString(1)%>" disabled="disabled"  maxlength="10"></td>
<td><input type="text"  name="empName" value="<%= rs.getString(2)%>" disabled="disabled" maxlength="10"></td>
</tr>
<% } %>
</table>

為此,我是否必須使用jQuery DataTable和mouseover()/ hover或其他東西。

應該是什么樣的正確方法?

看看以下鏈接,它將解釋有關鼠標懸停的更多信息,

http://jqfaq.com/how-to-highlight-rows-in-a-table-on-mouse-hover/

您可以輕松獲取上述鏈接中使用的_mousehover中行的詳細信息。 你可以展示它。 你想在工具提示中顯示它嗎?

編輯:這是在mousehover工具提示中使用tr信息的方法,

// Do this in _mousehover
$currentRow = $(event.target).closest('tr');
$currentRow.attr("title", $currentRow.attr("id"));

注意:在該示例中沒有tr的id。 所以,你必須添加它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM