inovua / reactdatagrid

Empower Your Data with the best React Data Grid there is
https://reactdatagrid.io
Other
3.45k stars 57 forks source link

editorProps does not exist in Column Definition #329

Open Azrideus opened 1 year ago

Azrideus commented 1 year ago

Relevant code or config

import '@inovua/reactdatagrid-enterprise/index.css';

import React, { useCallback, useState } from 'react';

import BoolEditor from '@inovua/reactdatagrid-community/BoolEditor';
import NumericEditor from '@inovua/reactdatagrid-community/NumericEditor';
import ReactDataGrid from '@inovua/reactdatagrid-enterprise';
import { TypeColumn } from '@inovua/reactdatagrid-community/types';

const gridStyle = { minHeight: 550 };

const App = () => {
    const [dataSource, setDataSource] = useState([]);
    const columns: TypeColumn[] = [
        { name: 'id', header: 'Id', defaultVisible: false, type: 'number' },
        { name: 'name', defaultFlex: 1, minWidth: 200, maxWidth: 300, header: 'Name' },
        {
            name: 'student',
            header: 'Student',
            width: 100,
            editor: BoolEditor,
            render: ({ value }) => (value ? 'Yes' : 'No'),
            editorProps: {
                style: { background: 'rgba(121, 134, 203, 0.25)' },
            },
        },
    ];
    return (
        <div>
            <ReactDataGrid
                idProperty="id"
                style={gridStyle}
                editable={true}
                columns={columns}
                dataSource={dataSource}
            />
        </div>
    );
};

export default () => <App />;

I was trying to create a simple BoolEditor editor column as documented in https://reactdatagrid.io/docs/api-reference#props-columns-editorProps there should be a editorProps property on the column definition, but it seems that is not the case

I also checked the typeDefinitions at TypeColumn.d.ts file, its not there

image

is the documentation outdated or am I missing something ? thanks for your time