FixedColumns initialization error

FixedColumns initialization error

thefunnymanthefunnyman Posts: 2Questions: 1Answers: 0
edited January 2015 in Free community support

Hi, I hope someone can help me here. I've downloaded the latest version of datatables and am using it in conjunction with bootstrap on an asp.net webforms site. The datatable in question is rendered via the asp.net GridView control. I have all this working just fine with zero configuration options. Here is the code I am using:

        var tbl = $('#<%=gv.ClientID%>').DataTable();

        new $.fn.DataTable.FixedColumns(tbl, { 
            "iLeftColumns": 1, 
        });

Pretty straightforward right? Well, when i execute this code, dataTables.fixedColumns.js dies on this line of the constructor:

"iTableColumns": dtSettings.aoColumns.length

With this error:

Uncaught TypeError: Cannot read property 'aoColumns' of undefined 

I know that in order to populate dtSettings, this line of code is utilized:

new $.fn.dataTable.Api( dt ).settings()[0]

I'm not much of a js dev, mostly a server-side developer who pretends to be a web developer. Could anyone help me to understand why this seemingly simple config is choking? Here's the real kicker, the fixed column still works! I just want to remove this js error so there are no unintended effects.

Thanks so much for any help you can provide!

Answers

  • thefunnymanthefunnyman Posts: 2Questions: 1Answers: 0

    Just as a follow up to this, I've tried to recreate the issue with live datatables, but i do not get the same error when using the same javascript and html that my page outputs. By all accounts it appears to be working the way i expect it to on live datatables. I have no clue where to start debugging this. Could anyone offer insight?

This discussion has been closed.