Our blazing fast Grid component built with pure JavaScript


Post by striker »

I need to type (<Store><any>this.grid.store).add ...

Attachments
problem8.png
problem8.png (11.05 KiB) Viewed 106 times

Post by sergey.maltsev »

Hi!

grid.store might have few types Store|object|Partial<StoreConfig>
To use Store please update code to the following

(grid.store as Store).add(args.tasks);

or

 const store = grid.store as Store;
 store.add(args.tasks);

Post by striker »

This is not same issue like here?
viewtopic.php?f=44&t=18638


Post by johan.isaksson »

It is the same issue. We have made progress on this in our documentation, which now specifies that it accepts multiple options but always outputs a Store.

But we do not yet have a way of representing it in TypeScript. Unfortunately doing so requires TypeScript 4.3, which is still pretty "new" (https://devblogs.microsoft.com/typescript/announcing-typescript-4-3/#separate-write-types).

Ticket to track (repurposed from the thread linked to above): https://github.com/bryntum/support/issues/3360

Best regards,
Johan Isaksson

Post by striker »

I understand. Thanks for reply!


Post Reply