Why I am getting this error by using fixed column ?

Why I am getting this error by using fixed column ?

kaushikclarionkaushikclarion Posts: 2Questions: 1Answers: 0

As soon as I add following property I am getting following error:

fixedColumns: {rightColumns: 1}

**Error: **

datatables.js:29290 Uncaught TypeError: Cannot read property 'cell' of undefined
at FixedColumns._fnCopyLayout (datatables.js:29290)
at FixedColumns._fnClone (datatables.js:29348)
at FixedColumns._fnCloneRight (datatables.js:29233)
at FixedColumns._fnDraw (datatables.js:29195)
at HTMLTableElement.<anonymous> (datatables.js:28842)
at HTMLTableElement.dispatch (jquery-3.1.1.min.js:3)
at HTMLTableElement.q.handle (jquery-3.1.1.min.js:3)
at Object.trigger (jquery-3.1.1.min.js:4)
at HTMLTableElement.<anonymous> (jquery-3.1.1.min.js:4)
at Function.each (jquery-3.1.1.min.js:2)

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @kaushikclarion ,

    As shown in this example here, if you're specifying the right column, you also need to set fixedColumns.leftColumns to 0.

    Cheers,

    Colin

  • kaushikclarionkaushikclarion Posts: 2Questions: 1Answers: 0

    Still not working ,

    I have fixed by adding following check
    // #:Kaushik fixed
    if (aoOriginal[i][j] == undefined) {continue;}

    under _fnCopyLayout function. however I am not sure whether I did correctly or not. because this may affect other functionality. But for time being i fixed the error.

    I am still keep open this ticket to get more appropriate answer.

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    We're happy to help if you can create a test case that demonstrates the problem - as that example I posted before shows, the code definitely works, so it's something with your configuration.

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Thanks for the code, but there's a lot there. As I said, could you create a test case please or link to your page. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.