Why rows() with a modifier causing Typescript to throw an error?

Why rows() with a modifier causing Typescript to throw an error?

joed67joed67 Posts: 8Questions: 4Answers: 1

This code works when using plain Javascript, but Typescript is throwing an error - is it correct?

var selRowData = mytable.rows({ selected: true }).data().toArray();

It says:

error TS2769: No overload matches this call.
[tsc] Overload 1 of 2, '(modifier?: ObjectSelectorModifier): RowsMethods<any>', gave the following error.
[tsc] Argument of type '{ Selected: boolean; }' is not assignable to parameter of type 'ObjectSelectorModifier'.
[tsc] Object literal may only specify known properties, and 'Selected' does not exist in type 'ObjectSelectorModifier'.
[tsc] Overload 2 of 2, '(rowSelector: RowSelector<any>, modifier?: ObjectSelectorModifier): RowsMethods<any>', gave the following error.
[tsc] Argument of type '{ Selected: boolean; }' is not assignable to parameter of type 'RowSelector<any>'.
[tsc] Object literal may only specify known properties, and 'Selected' does not exist in type 'Node | JQuery<HTMLElement> | ((idx: number, data: any, node: Node) => boolean) | RowSelector<any>[]'.

Answers

  • allanallan Posts: 56,483Questions: 1Answers: 8,964 Site admin

    I suspect the ObjectSelectorModifier doesn't have a selected option. Thanks for letting me know about that, I'll look into it.

    Allan

  • joed67joed67 Posts: 8Questions: 4Answers: 1

    It looks like "filter" is getting flagged also.

Sign In or Register to comment.