Yes. Actually When result found at that time I show two buttons. "Export to list" and "Close". To show "Export to list" button, I have to detech the .csv button from dataTables and add in one DIV.
 var csvButton = $(".DTTT_button_csv").detach();
 $("#newPosition").append( csvButton );

But When no result found I have to show only Close button.

So to avoid the complexity of code I used to close button.