6pac / SlickGrid

A lightning fast JavaScript grid/spreadsheet
https://github.com/6pac/SlickGrid/wiki
MIT License
1.82k stars 424 forks source link

fix: `column.editor` and `gridOptions.editorFactory` type changed #995

Closed manfredwippel closed 5 months ago

manfredwippel commented 6 months ago

editor and edtitor factory do not return an Editor Object but a typeof Editor to be constructed with new (...) Otherwise it is impossible to implement an Editor Factory in Typescript

ghiscoding commented 6 months ago

It would also be nice if you could provide code sample of how you expect to use this as an Editor Factory like you mentioned. Thanks

manfredwippel commented 6 months ago

It would also be nice if you could provide code sample of how you expect to use this as an Editor Factory like you mentioned. Thanks

I would provide an example and tests after I figured out a proper solution. I am currently implementing Slick Grid as Serverside rendered control for our project and would create clean JSON without javascript references. Therefore I would need to extend Column Metadata and Editor functionality to define editors, formaters, validators and enable conditions per definition.

ghiscoding commented 6 months ago

@manfredwippel I found 2 more lines to update, if you could please fix them, we could then go ahead with the merge. Thanks

ghiscoding commented 5 months ago

@manfredwippel the build is failing in the UI, I have identified at least 1 duplicate import as shown above. The CI runs the build:prod script as shown below, so please make sure you run it too npm run build:prod

https://github.com/6pac/SlickGrid/blob/61e73db0027d10714a8b4ca8f19f4ccb37269301/package.json#L58

ghiscoding commented 5 months ago

ok it looks good now, let's merge. I'm not sure when I'll push a new release but sometime this week I guess, if not please remind me

ghiscoding commented 5 months ago

@manfredwippel I have replicated your PR into my lib Slickgrid-Universal and I found a small problem, you've assigned EditorArguments as optional and possibly undefined to the EditorConstructor but that's technically impossible because without it, the Editor simply won't work or do anything since it gets all its data through that argument. So would you like to create another PR to resolve this issue?

https://github.com/6pac/SlickGrid/blob/e02cf641a393528ae366edacf86b8f3eec6ef8a5/src/models/editor.interface.ts#L87-L88

ghiscoding commented 5 months ago

now available in v5.8.2, thanks for the contribution