Column Toggle doesn't work if table is editable

UI Components for React
Post Reply
k41nt
Posts: 1
Joined: 14 Jul 2020, 01:58

14 Jul 2020, 05:46

I'm using Primereact Datatable and trying to add column toggle to my table. However, the table is editable and it just doesn't work with column toggle. My guess is that <MultiSelect> has some problem with it, or I might have missed something? I have created a sample code with codesandbox below:
https://codesandbox.io/s/primereact-dat ... -bug-3fxho
Any help would be greatly appreciated!

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

11 Oct 2020, 00:13

Hi,

Sorry for the delayed response! Please try;

Code: Select all

<MultiSelect
        value={selectedColumns}
        options={columns}
        optionLabel="field"
        dataKey="field"
        onChange={onColumnToggle}
        selectedItemTemplate={(val) => val ? val.field + ' ' : ' '}
        style={{ width: "250px" }}
      />
Best Regards,

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 23 guests