reactdatagrid icon indicating copy to clipboard operation
reactdatagrid copied to clipboard

editorProps does not exist in Column Definition

Open Azrideus opened this issue 2 years ago • 0 comments

  • what edition are you using - community
  • version for @inovua/reactdatagrid-community 4.8.1

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

Azrideus avatar Jan 23 '23 07:01 Azrideus