react-data-grid icon indicating copy to clipboard operation
react-data-grid copied to clipboard

[Feature request] Fillable but not editable columns

Open dmtrKovalenko opened this issue 3 years ago • 2 comments

My use case is a dropdown column where the user can immediately click on a column to select an option while also seeing drag to fill control, I am achieving this by using onRowChange of theformatter component.

image

But according to this line, https://github.com/adazzle/react-data-grid/blob/main/src/DragHandle.tsx#L92-L98 the drag-to-fill control do nothing if the editor is not specified (another question why render it at all if it is doing nothing)?

So I need to do something like this to make it work, while it still hides the fill control on double click into the field:

editor: function DropdownColumnFormatter({ row, onClose, onRowChange }) {
    return (
      <DropdownColumnSelect
        {...props}
        // This will open and focus dropdown on enter press in view mode or dblclick
        openOnMount
        row={row}
        onRowChange={row => { 
          console.log(row)
          onRowChange(row, true);
          onClose()
        }}
      />
    );
  },
  editorOptions: {
    renderFormatter: true,
  },
  formatter: function DropdownColumnFormatter({ row, onRowChange }) {
    return (
      <DropdownColumnSelect
        openOnMount={false}
        {...props}
        row={row}
        onRowChange={onRowChange}
      />
    );
  },

I would expect to not specify these props at all or just editable: true and still having an ability to change the row by filling without rendering editor

dmtrKovalenko avatar Dec 27 '22 13:12 dmtrKovalenko

I know this is an old issue but is this something that is still needed?

amanmahajan7 avatar Aug 18 '25 22:08 amanmahajan7

This would be useful for our use case where we also have some of these cells (editable but no renderEditCell specified).

milomord avatar Aug 28 '25 21:08 milomord