tablesorter的寻呼机插件 - Ajax和子行寻呼机、插件、tablesorter、Ajax

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

需要的是用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.

阅读全文

相关推荐

最新文章