$(document).ready(function() {
/* Add/remove class to a row when clicked on */
$('#example tr').click(function() {
$(this).toggleClass('row_selected');
});
/* Init the table */
var oTable = $('#example').dataTable();
});
/*
* I don't actually use this here, but it is provided as it might be useful and demonstrates
* getting the TR nodes from DataTables
*/
function fnGetSelected(oTableLocal)
{
return oTableLocal.$('tr.row_selected');
}
你需要提供比更多的信息。你有任何可以显示的HTML代码吗?当用户点击行时会发生什么? – PinnyM
我有HTML
回答
如果您正在使用jQuery插件数据表,这里有个例子: http://datatables.net/release-datatables/examples/api/select_row.html
来源
2012-12-12 15:38:30
相关问题