rowReordering Plug-in: Call Row Drag & Drop plugin after the JSON object is loaded from the server

rowReordering Plug-in: Call Row Drag & Drop plugin after the JSON object is loaded from the server

jan_nemecjan_nemec Posts: 1Questions: 0Answers: 0
edited June 2012 in Plug-ins
Hello,
I am using ASP.net MVC and DataTables plugin which is configured to load rows via AJAX call (bServerSider: true & sAjaxSource: someUrl). I would like to combine it with rowReordering addon for drag and drop but I can not solve this problem:
When I initialise DataTables plugin and call reordering plugin [code]$('#myDataTable').dataTable().rowReordering();[/code] the reordering plugin according to Firebug is called before the JSON object is loaded from the server and the data are populated. When I don't load data for the table from the server, rowReordering is OK.
How can I call reordering plugin after the data for table are loaded from the server?
Thanks for helping.
Best regards,
Jan Nemec

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    HI Jan,

    I suspect you will need to call it when the data has been retrieved from the server - this is done using fnInitComplete. For example (depending on how the rowReordering plug-in is written) you might be able to do:

    [code]
    fnInitComplete: function () {
    this.rowReordering();
    }
    [/code]

    Allan
This discussion has been closed.