Can't able to redraw Datatable

Can't able to redraw Datatable

dharmeshpatel82dharmeshpatel82 Posts: 15Questions: 2Answers: 0
edited April 2014 in DataTables 1.9

I have a Datatable on page, and Also I put a link to reload this Datatable (User interaction is required to refresh Datatable, and for some reason I have to put refresh link outside of Datatable Division.) and this is a ServerSide Datatable.

On page load I got my Datatable loaded but when I clicked on refresh link It is not working.

My refresh link click event is :
$(document).on('click', '#refreshLinkId', function (event) {
var tblId = $(this).attr("type") + "_wrapper";//getting Datatable ID
var table = $(tblId).dataTable();


$('#refreshConfirmDialogId').data('tableInst', table );

When I click the link I got this Warning :
DataTables warning: Attempted to initialise DataTables on a node which is not a table: DIV

and got this error too when I try to call fnDraw or any other internal Method of DataTable instance(found through Firebug) :
TypeError: a is null
[Break On This Error]

...Sort ? O(a, a.oPreviousSearch) : a.oFeatures.bFilter ? K(a, a.oPreviousSearch) :...

Does anybody knows, whats wrong with my code? Also I want to redraw my Datatable with extra server param on refresh link click which will be added to Ajax Request to get Modification in Database and return new Data, I do not know how can I do that?

Please let me know if there is a solution for this?

Thank you.


  • allanallan Posts: 54,900Questions: 1Answers: 8,605 Site admin
    This tech note explains that error in details: .

    Beyond that, please link to a test case showing the issue.

  • dharmeshpatel82dharmeshpatel82 Posts: 15Questions: 2Answers: 0
    edited April 2014
    Hello Allan,

    Thank you for the note, It absolutely gave me a direction. I realize we can call initialized table anywhere in the page and unless it is destroyed.

    My Stupid mistake was, I was selecting Table Div instead I should select Table. I just had to remove "_wrapper" from Table id, where "_wrapper is Table Div Id." :)

    My apologies. Sometimes small mistake is there but I can't see. Very Stupid.

    But your note confirms me that we can get instance of table anywhere within the reach. Thank you.
    Now I just need to figure out how to add extra param to server request before re-draw table.

    Thank you very much Allan for your help. Really appreciated.

    Dharmesh Patel
This discussion has been closed.