Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript: Rersharper error when errorTextFormat is set for delGridRow() #416

Closed
askrinnik opened this issue Jan 25, 2018 · 2 comments
Closed

Comments

@askrinnik
Copy link

Hi @OlegKi
I wanted to invoke delGridRow method with setting errorTextFormat:

grid.delGridRow(rowId, {
  errorTextFormat(data: JQueryXHR) {
    return data.responseText;
  }
});

But I got an error from Resharper:

Supplied parameters do not match any signature of call target: parameter type mismatch. Parameter 'options' should have type assignable to 'FreeJqGrid.FormDeletingOptions', but it has type '{ [index: string]: (data: JQueryXHR) => string; errorTextFormat: (data: JQueryXHR) => string}'.

It caused because the second parameter of the method is options: FreeJqGrid.FormDeletingOptions
The interface doesn't have errorTextFormat. But in fact it is used in javascript code of the grid

I managed to fix the error when added a property errorTextFormat into interface FormDeletingOptions in free-jqgrid.d.ts
errorTextFormat?: (this: BodyTable, data: JQueryXHR) => string;

Is this correct way?

@askrinnik askrinnik changed the title TypeScript: Rersharper error when in errorTextFormat is set for delGridRow() TypeScript: Rersharper error when errorTextFormat is set for delGridRow() Jan 25, 2018
OlegKi added a commit that referenced this issue Jan 25, 2018
…ns of free-jqgrid.d.ts

Thanks @askrinnik (https://github.com/askrinnik) for reporting the problem. See [the issue #416](#416) for reporting the problem.
@OlegKi
Copy link
Member

OlegKi commented Jan 25, 2018

Thanks you Alexander for the feedback! You are right - some properties / callbacks missing in FreeJqGrid.FormDeletingOptions. I looked one more thought the code and extended FormDeletingOptions (see the commit). The problem should be fixed now.

@askrinnik
Copy link
Author

Sounds great. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants