DataTable's checkbox selection has different behavior in PrimeReact 6

UI Components for React
Post Reply
Posts: 2
Joined: 03 May 2021, 10:36

03 May 2021, 10:50

Code: Select all

                    <DataTable value={this.state.products} selection={this.state.selectedProducts3} onSelectionChange={e => this.setState({ selectedProducts3: e.value })} dataKey="id">
                        <Column selectionMode="multiple" headerStyle={{width: '3em'}}></Column>
                        <Column field="code" header="Code"></Column>
                        <Column field="name" header="Name"></Column>
                        <Column field="category" header="Category"></Column>
                        <Column field="quantity" header="Quantity"></Column>
In V4 and V5 you had to click on the actual checkbox to make a selection. Clicking anywhere else in the row triggered no action. This is desirable in case user wants to highlight text for copy /paste. ... /selection

On the other hand, in V6, clicking anywhere on the row triggers a selection. Making it imposible to highlight text without triggering a row selection. ... /selection

Is there a way to have a multiple Checkbox-Only Selection in v6?

Posts: 4710
Joined: 29 Jun 2013, 12:38

07 May 2021, 00:47


Yes, you can use selectionMode="checkbox" for it.

Exp; ... /selection

Best Regards,

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests