Buttons: Too many iteration error Covis

Buttons: Too many iteration error Covis

rpandeyrpandey Posts: 4Questions: 1Answers: 0
edited September 2015 in Free community support

I get "Too many iterations" error when I try to use "colvis". Not sure what is wrong.This is how I am using it. I also included the colvis.js and .css files but the colvis button doesnot show up.

var degtable = $('#degtable').DataTable({
            dom: 'Bfrtip',
            buttons: [{
                    extend: 'csv',
                    text: 'csv export'
            },
                {
                    extend: 'excel',
                    text: 'excel export',
                    exportOptions:
                    {
                        columns: ':visible'
                    }
                },
                {
                    extend: 'colvis'
                }
         ]

        });

Any help is ppreciated

Answers

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75
    edited September 2015

    How many columns does your table have?

    And @allan, actually curious about this... how many Columns does ColVis support? (Or DT in general?)

    Is there ANY column limit restrictions? For any of the plugins/extensions?

    @rpandey Try to reproduce your error on http://live.datatables.net or/and create a debug thingy ( https://debug.datatables.net/ )

  • rpandeyrpandey Posts: 4Questions: 1Answers: 0

    table has 6 columns. export buttons show up but not the colvis

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    ok. Can you create a live.datatables.net instance? SHould be able to copy and paste your code

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    Or atleast a debugger. You're giving very little info to go on

  • rpandeyrpandey Posts: 4Questions: 1Answers: 0

    The reason I am not able to use live.datatables.net instance is that along with buttons I also need to use the plugins/extensions - jszip.min.js and buttons.html5.min.js files for the excel and csv export. I am not sure how I can use them live.datatables.net .

    will try to explain here-
    I am using jszip.min.js and buttons.html5.min.js along with buttons to provide the feature for exporting data. This works correctly. I wanted to use "colvis" to allow the functionality for user to select the columns to include in exporting data. but when I use "colvis" I see the console wrror - "Too many iterations" and it messes up the datatable. Here is the js code I am using on the table.
    var degtable = $('#degtable').DataTable({
    dom: 'Bfrtip',
    buttons: [{
    extend: 'csv',
    text: 'csv export'
    },
    {
    extend: 'excel',
    text: 'excel export',
    exportOptions:
    {
    columns: ':visible'
    }
    },
    {
    extend: 'colvis'
    }
    ]

        });
    
        // Apply the search
        degtable.columns().every(function () {
            var that = this;
    
            $('input', this.footer()).on('keyup change', function () {
                that
                    .search(this.value)
                    .draw();
            });
        });
    
  • allanallan Posts: 62,057Questions: 1Answers: 10,173 Site admin

    I am not sure how I can use them live.datatables.net

    Like you would do on any web page - just include them using a script tag. Or use the download builder to create the URLs for you and paste them in.

    We will need a test case to be able to offer any help here as this should work.

    And @allan, actually curious about this... how many Columns does ColVis support? (Or DT in general?) Is there ANY column limit restrictions? For any of the plugins/extensions?

    There is no limit. Browser performance will degrade after a while of course, but there is no hard limit in the code.

    Allan

This discussion has been closed.