tablesorter的寻呼机插件 - Ajax和子行 [英] Tablesorter pager plugin - ajax with child rows

查看:89
本文介绍了tablesorter的寻呼机插件 - Ajax和子行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要的是用ajax从服务器上拉,以分页的方式present数据(见的 http://mottie.github.io/tablesorter/docs/example-pager-ajax.html )。 这些数据是由主行和子行(每个主行,还有一个子行)(见 http://mottie.github.io/tablesorter/docs/example-child-rows.html )。

The need is to present data pulled from the server using ajax, in a paginated fashion (see http://mottie.github.io/tablesorter/docs/example-pager-ajax.html). Those data are made of "main rows" and of child rows (for each "main row", there is a child row) (see http://mottie.github.io/tablesorter/docs/example-child-rows.html).

由于AJAX数据必须psented到tablesorter的是贾森格式$ P $,我应该怎么指定某些行是子行?

Since the ajax data that must be presented to tablesorter is in jason format, how should I specify that some rows are child rows?

推荐答案

您可以在JSON中存储数据的HTML标记,如:

You can store the data within the JSON as HTML markup, e.g.

{
    "rows" : [
        "<tr><td>r0c0</td><td>r0c1</td></tr>",
        "<tr class='tablesorter-childRow'><td>r1c0</td><td>r1c1</td></tr>",
        "<tr><td>r2c0</td><td>r2c1</td></tr>",
        "<tr class='tablesorter-childRow'><td>r3c0</td><td>r3c1</td></tr>"
    ]
}

然后就成立了 ajaxProcessing 函数此数据。

Then just set up the ajaxProcessing function to work with this data.

这篇关于tablesorter的寻呼机插件 - Ajax和子行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆