JQuery DataTable加载所选行的页面 [英] JQuery DataTable Load the page of the selected row
问题描述
我正在使用一个JQuery DataTable。
在我的服务器端代码中,我重新审视了记录ID并将其传递给了我的javascript函数。 >
我的javascript函数将根据行ID查找行,然后将该类设置为选定。
function selectBuyer(agid)
{
$('#tr_buyer_'+ agid).addClass(row_selected);
}
这样可以相应地显示该行。
但是我希望datatable可以导航到该记录。所以如果在第3页,它会显示第3页。目前,如果我浏览到第三页,它将显示突出显示的行。
任何想法?
http://datatables.net/plug-ins/api
我发现一个类似的问题,它指示我到数据库api。有一个名为fnDisplayRow的函数。它将显示与您发送的行相对应的页面。
我只需要做一些调整,将其模拟成我的特定场景
I am using a JQuery DataTable.
In my server side code, I am re-trieving the record id and passing it to my javascript function.
My javascript function will look for the row as per the row id and then set the class to selected.
function selectBuyer(agid)
{
$('#tr_buyer_' + agid).addClass("row_selected");
}
This works and highlights the row accordingly.
However I would like the datatable to navigate to that record. So if it was on the 3rd page, it will display the 3rd page. Currently right now, if I navigate to the third page, it will show the highlighted row.
Any ideas?
http://datatables.net/plug-ins/api
I found a similar question and it directed me to the datatables api. There is a function called fnDisplayRow. It will display the appropriate page with the row you send it.
I just need to do some tweaking to mold it into my particular scenario
这篇关于JQuery DataTable加载所选行的页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!