How to add a new button left side of the pagination buttons and show all records on click?

How to add a new button left side of the pagination buttons and show all records on click?

dineshckdineshck Posts: 3Questions: 1Answers: 0

I am trying to add a new button left side of the pagination button and on clicking the button it should display all the records int the data table. Your help will be highly appreciated. Thanks in advance

Answers

  • dineshckdineshck Posts: 3Questions: 1Answers: 0
    edited March 2015

    var thisTable = $('table#tickets.tkt').dataTable({

    "iDisplayLength": 25,
    "aoColumns": dontSort1,
    "aaSorting": [[ 0, 'desc']],
    "bRetrieve": true,
    "sDom": '<"top"f>rt<"bottom"pi><"bottom" <"#taskbuttonfilternew">><"clear">',
    "fnDrawCallback": function(oSettings) {
    $('#taskbuttonfilternew').html('');
    $('#taskbuttonfilternew').append('<button type="button" role="button" class="btn btn-mini pull-right" style="margin-top:5px;margin-left:10px;"><?php echo $this->lang->line('application_all');?></button>');
    }

            });
    

    and added -

    $('#taskbuttonfilternew').click(function(){

                 var oSettings = thisTable.fnSettings();
                 oSettings._iDisplayLength = parseInt(-1);
                 thisTable.fnDraw( oSettings );
    
            });
    

    may be helpful to someone...

This discussion has been closed.