≡

fixedColumns() not resolvable with 3.1.1

fixedColumns() not resolvable with 3.1.1

sebastianbarthsebastianbarth Posts: 70Questions: 14Answers: 0

Hi again Allan,

Using Datatables 3.1.1 I have trouble accessing the fixedColumns() method (no problem with DT 2.3.8).

"datatables.net": "3.1.1"
"datatables.net-dt": "3.1.1"
"datatables.net-fixedcolumns": "6.1.0"
"datatables.net-scroller": "3.1.0"
"datatables.net-scroller-dt": "3.1.0"
...
"typescript": "6.0.3"
import 'datatables.net-fixedcolumns';
const dataTable: Api<BaseTableRowData> = ...;
dataTable.fixedColumns().left(columnCount); // Fails with following error
TS2339: Property fixedColumns does not exist on type Api<BaseTableRowData>

Anything wrong with my setup or did the augmentation of the API by the fixed column plugin break?
Any idea?

I use Intellij Ultimate (contains Webstorm).

Cheers
Sebastian

Answers

  • allanallan Posts: 66,048Questions: 1Answers: 10,997 Site admin

    Hi Sebastian,

    You are absolutely right - that's a bug on my part. I hadn't correctly extended the DataTables Api interface. I've corrected that and I'll do a patch release, possibly tomorrow all being well to address this. I've checked over the other extensions and they are all fine - just FixedColumns!

    Allan

  • sebastianbarthsebastianbarth Posts: 70Questions: 14Answers: 0

    Awesome, thanks!

    I just noticed that it is not necessary to have both, the normal and "-dt" dependencies.

  • sebastianbarthsebastianbarth Posts: 70Questions: 14Answers: 0
    edited September 29

    With 3.1.2 and fixedcolumns at 6.1.1 I still have the issue:

      "datatables.net-dt": "3.1.2"
      "datatables.net-fixedcolumns": "6.1.1"
      "datatables.net-scroller": "3.1.1"
      "datatables.net-scroller-dt": "3.1.1"
    
    import type { Api } from 'datatables.net-dt';
    import 'datatables.net-fixedcolumns';
    

    Is there anything wrong on my side?

  • allanallan Posts: 66,048Questions: 1Answers: 10,997 Site admin

    I've just tried it here: https://stackblitz.com/edit/uwusqjsh?file=src%2Fmain.ts%2Cindex.html . It seems to be working as expected.

    Are you able to link to a minimal test repo showing the issue, or a StackBlitz example showing it?

    Allan

  • sebastianbarthsebastianbarth Posts: 70Questions: 14Answers: 0

    The problem is not that the fixedColumns() is missing. It is just not visible to TS. At runtime it is there.
    What online platform could I use to reproduce this TS issue - What would be the best for you?

    Greetings
    Sebastian

  • allanallan Posts: 66,048Questions: 1Answers: 10,997 Site admin

    Hi Sebastian,

    StackBlitz will show TS errors (compile and runtime) - I've updated the example blitz I posted before to use a property that doesn't exist and it correctly shows an error:

    Indeed, hovering over the .fixedColumns() part correctly shows the TS comment information.

    If the error can't be reproduced on StackBlitz, you could use a minimal git repo perhaps?

    Allan

  • sebastianbarthsebastianbarth Posts: 70Questions: 14Answers: 0
    edited September 30

    Thanks Allan, I indeed had a stale node_modules state, although I can't explain how it could ended up like this.
    Sorry for the trouble!

    Seems all fine now, with the fixedColumns API method and config option, now.

  • allanallan Posts: 66,048Questions: 1Answers: 10,997 Site admin

    Not a problem at all. Glad it is sorted :)

    Allan

Sign In or Register to comment.