开发者

JQuery DataTables: adjust column size without redrawing the table and making a new ajax call

I am using the jquery datatables plugin on a project using server side processing to populate the data table开发者_如何转开发 ( using servlets ). I am also using jquery ui layout plugin so I am trying to tie resizing of a pane to readjust the column sizing of the table on call back. This is working but when I check firebug I see that each call to fnAdjustColumnSizing is calling my ajax servlet. I assume this is through calling the fnDraw method but I am not certain. Is there a way to get it to readjust without making a new ajax call?

I am paginating literally hundreds of thousands of rows if the user decides to so recalling the servlet for this purpose is possibly a big waste of time for the user. Any help would be greatly appreciated!


http://datatables.net/ref#fnAdjustColumnSizing - you can pass false as the first parameter to stop it redrawing, but the new sizes wouldn't be taking into effect until a draw is done... There are ways you can do this (calling the internal functions such as _fnScrollDraw) however:

Are you passing back hundreds of thousands of rows every time? With server-side processing (which I presume is what you are using) you only need to return the rows that are to be displayed.


You can add nowrap attribute to td tag, so its adjust width of your data, you can try something like these :-

<table>
    <tr>
        <td nowrap="nowrap"></td>
    </td>
</table>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜