Incorrect typing in flexmonster.d.ts

Re-Open
Michael Einsohn asked on November 19, 2021

The docs say that Flexmonster.Options.grid.showTotals takes a string value, with these recognized values: 'on' 'off', 'rows', or 'columns'.
 
When trying to add the value 'rows', the TS compiler throws because the typing, defined in node_modules/flexmonster/types/flexmonster.d.ts declares the property as a boolean on line 353:

showTotals?: boolean; // this should be string

changing the type to string works, when tested locally, but the solution can't be shared with the team. 
For now I've resorted to this in my calling component:

...
// @ts-ignore
showTotals: 'rows',
...

Please update the npm package when you can.
Thanks!

3 answers

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster November 22, 2021

Hi Michael,
 
Thank you for noticing this, the showTotals type should indeed be a string.
 
We are going to fix this in our upcoming release on ETA Nov 29th
 
Please let us know if there is anything else we can help you with in the meantime.
 
Best regards,
Mykhailo

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster November 30, 2021

Michael,
 
Hope you're doing well!
 
The type definition for the grid.showTotals option was fixed.
 
The fix is available in the 2.9.13 version of Flexmonster: https://www.flexmonster.com/release-notes/.
 
You are welcome to update the component. Here is our updating to the latest version tutorial for guidance: https://www.flexmonster.com/doc/updating-to-the-latest-version/.
 
Please let us know if everything works fine for you.
 
Regards,
Mykhailo

Public
Michael Einsohn January 28, 2022

Delayed reaction!  Everything looks good for me, thanks!
 

Please login or Register to Submit Answer