hide and show of Buttons

hide and show of Buttons

ruffnroughruffnrough Posts: 2Questions: 1Answers: 1

I am using the sExtends; "collection" with 5 listed buttons under it. I am trying to automate the use of these buttons by hiding and showing them when they are needed..

Here is what is happening.
I create the datatable. My list of buttons hide correctly at this point. if I paginate or select new rows the buttons update correctly. If I destroy the datatable and then create it again the show() and hide() methods do not work at this point. I tried this in my inspector and the first load works great. i then destroy the table with another process in my program and it does not work in the inspector anymore after the destroy.

Not sure if this is a bug? Or, if I am missing something. I have looked through this site, stackoverflow, and google and could not find any fixes. Anyone know why these methods will not function after a datatable destroy.

This question has an accepted answers - jump to answer

Answers

  • ruffnroughruffnrough Posts: 2Questions: 1Answers: 1
    edited August 2015 Answer ✓

    Ok,

    Further research. I found that when destroying the table the button

    <

    ul> was not being destroyed. So the pointer to the original was still there, but I had a new

    <

    ul> of these buttons after the new table was instantiated. Once I add this to the destroy check, it worked.

     $(".DTTT_dropdown").remove();
    

    In this test...

    if ($.fn.dataTable.isDataTable(PTRK_GRID)) {
           PTRK_GRID.DataTable().destroy();
           $(".DTTT_dropdown").remove();
           PTRK_GRID.empty();
    }
    
This discussion has been closed.