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

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

joed67joed67 Posts: 14Questions: 6Answers: 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: 61,446Questions: 1Answers: 10,054 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: 14Questions: 6Answers: 1

    It looks like "filter" is getting flagged also.

Sign In or Register to comment.