Skip to content

Plain JS version (i.e. no React dependency) #51

Open
@Ryan-Palmer

Description

@Ryan-Palmer

Hello!

We are using AgGrid in a Sutil application, and as such we interact with the JS API rather than React.

I found I could use pretty much every part of this binding apart from

  • The cell renderer bits
  • The .grid<'row> function that returns a React element.

Other than deleting those functions, I just had to add

type IGridApi = interface end

[<Import ("createGrid","ag-grid-community")>]
let private createGrid (props: HTMLElement * obj) : IGridApi = jsNative

to get a ref to the JS class constructor, then change the grid function to

static member inline createGrid<'row> (container : HTMLElement) (props:IAgGridProp<'row> seq) =
    createGrid(container, createObj !!props)

It would be cool to be able to import and use this library (and contribute back to it if we add anything!). Is there any way to publish the plain JS part without the React dependency, and then release a React 'add on' package to provide the framework specific stuff?

Cheers :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions