CompositionalIT / feliz-ag-grid

9 stars 4 forks source link

Missing method `cellEditor` in ColumnDef #4

Closed TerenceHinrichsen closed 1 year ago

TerenceHinrichsen commented 2 years ago

Just want to check whether this awesome library is being maintained? I want to add a "select" component to my grid, and according to these docs I need to pass a custom component to the cellEditor.

Am I missing it somewhere? Sorry if it is a stupid question.

theprash commented 2 years ago

FYI you might want to consider using cellRendererFramework, which is already implemented. It's a different approach where you completely take over the rendering of the cell, even if it isn't being edited, rather than allowing ag-grid to render the cell until you double click to edit. This way, all rows would show a select in the column when the grid loads.

Adding cellEditor would be good too because it has different advantages.

zwpdbh commented 1 year ago

"you might want to consider using cellRendererFramework" Exceus me, could you provide a simple demo like https://www.ag-grid.com/javascript-data-grid/component-cell-renderer/?#simple-cell-renderer-example

That will be very helpful. Thanks a lot.

zwpdbh commented 1 year ago

Found how to use the cellRendererFramework:

 ColumnDef.create<string> [
            ColumnDef.cellRendererFramework (fun _v row ->
                Html.a [
                    prop.text row.Id
                    prop.onClick (fun _ ->
                        printfn $"{row.Id}"
                    )
                ]
            )
            ColumnDef.filter RowFilter.Text
            ColumnDef.headerName "ID"
        ]
theprash commented 1 year ago

Thanks for that @zwpdbh. I'm going to add an example column to the demo code in the repo as well

theprash commented 1 year ago

@zwpdbh The demo now uses more functionality including cellRendererFramework.