开发者

jQuery DataTables and Initial Data Load

I asked this question on the jQuery Datatable forum but it wasnt much help. If anyone has worked with jQuery datatables and got it to work by setting the initial data when requesting the options, and not having the ajax call go out for page 1. When my sAjaxSource is set during the init stage it automatically makes the request out again to load the data even thou开发者_运维百科gh I initialized it with data.

http://datatables.net/forums/discussion/6459/load-initial-data-without-ajax-call#Item_3


I think you are looking for the iDeferLoading feature.

$(document).ready(function() {
    $('#example').dataTable( {
        "bProcessing": true,
        "bServerSide": true,
        "sAjaxSource": "scripts/server_processing.php",
        "iDeferLoading": 57
    } );
} );

UPDATE: I just read your question in the forum. Perhaps your problem is not so simple after all, but I would need to see your datatables set up in order to give you a more informed opinion.

I use datatables in a production environment and I know a bit about the API; but again, without looking at your setup and understanding exactly what's the deal with your second ajax call, it's difficult to help. I'll leave this answer here for what it's worth.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜