datatables.net-fixedcolumns-dt and datatables.net-fixedcolumns are not working together
datatables.net-fixedcolumns-dt and datatables.net-fixedcolumns are not working together
Hello
I adding these imports to my Typescript file:
import DataTables from "datatables.net";
import "datatables.net-dt";
import "datatables.net-fixedheader";
import "datatables.net-fixedheader-dt";
import "datatables.net-fixedcolumns";
import "datatables.net-fixedcolumns-dt";
import "datatables.net-responsive";
import "datatables.net-responsive-dt";
but I get the following error in VS2022:
error TS2307: Build:Cannot find module './FixedColumns' or its corresponding type declarations.
error TS2717: Build:Subsequent property declarations must have the same type. Property 'fixedColumns' must be of type 'boolean | ConfigFixedColumns', but here has type 'boolean | ConfigFixedColumns'.
error TS2717:Build:Subsequent property declarations must have the same type. Property 'fixedColumns' must be of type 'ConfigFixedColumnsLanguage', but here has type 'ConfigFixedColumnsLanguage'.
error TS2717:Build:Subsequent property declarations must have the same type. Property 'FixedColumns' must be of type '{ new (dt: Api<any>, settings: string[] | ConfigFixedColumns | ConfigFixedColumns[]): any; version: string; defaults: ConfigFixedColumns; }', but here has type '{ new (dt: Api<any>, settings: string[] | ConfigFixedColumns | ConfigFixedColumns[]): any; version: string; defaults: ConfigFixedColumns; }'.
If I remove the
import "datatables.net-fixedcolumns-dt";
the error goes away, I'm using webpack, any advise?
Replies
Can't figure out why, even adjusted the forceConsistentCasingInFileNames but no help.
Severity Code Description Project File Line Suppression State
Error TS2769 (TS) No overload matches this call.
Overload 2 of 3, '(opts?: Config): Api<any>', gave the following error.
Argument of type '{ fixedHeader: true; responsive: true; searchHighlight: true; searching: true; fixedColumns: boolean; paging: false; order: (string | number)[][]; columns: ({ orderable: false; width: string; responsivePriority: number; } | { ...; })[]; autoWidth: false; }' is not assignable to parameter of type 'Config'.
Object literal may only specify known properties, and 'fixedColumns' does not exist in type 'Config'. H:\Workshop\BIM Catalyst\Web Apps\Autodesk Forge SDK\BIM360PP\src\tsconfig.json H:\Workshop\BIM Catalyst\Web Apps\Autodesk Forge SDK\BIM360PP\src\Components\files-table.ts 675 Active
If you just use:
does it then work for you? The
-dt
packages depend on their core packages, so you don't need to include both.If that doesn't fix it, can you create a demo git repo that shows that issue please?
Allan
Hello @allan
I've created this repository, and unfortunately the Datatables is not identifies as JQuery plugin:
https://github.com/mustafasalahuldin/Using-datatables.net-in-.Net-7
I fixed the issue by installing the jquery types, butt still can't use the fixed columns and other attributes