Devextreme-reactive: Selection with 3 states including indeterminate

Created on 23 Jul 2018  路  3Comments  路  Source: DevExpress/devextreme-reactive

  • [x] I have searched this repository's issues and believe that this is not a duplicate.

I'm using ...

  • [x] React Grid
  • [ ] React Chart
  • [ ] Vue Grid

Expected Behaviour

Having a Checkbox that allows 3 states (false, indeterminate, true). We are building an app where either the user or the business updates the grid and selects data.

If the user has checked the checkbox we want to output value true, but if the business layer has checked the checkbox we want it to be checked as indeterminate.

If the RowID is on both arrays then true wins over indeterminate.

Attempts to achieve this

I took as base the solution to a similar (yet different) issue: https://stackblitz.com/edit/react-deg9yu

But I haven't been able to pass an indeterminate property to the cell, similar to how selected property works.

Environment

  • "@devexpress/dx-react-core": "^1.4.0"
  • "@devexpress/dx-react-grid": "^1.4.0"
  • "@devexpress/dx-react-grid-material-ui": "^1.4.0"
  • "@material-ui/core": "^1.4.0"
  • "@material-ui/icons": "^1.1.0"
  • "react": "^16.4.1"
Grid question

Most helpful comment

Awesome, it works like a charm! Thanks :)

Maybe all these examples would be useful to be indexed on your website demos.

Congratulations on this excellent library ;)

All 3 comments

Hi,

To achieve this behavior, pass a custom聽TableSelectCellcomponent to the聽TableSelection plugin's聽cellCompopnent property.

In the following example, the聽state property has two arrays:聽selectionByUser聽specifies items selected by a user;聽selectionAsIndeterminate specifies items that have indeterminate state.

Awesome, it works like a charm! Thanks :)

Maybe all these examples would be useful to be indexed on your website demos.

Congratulations on this excellent library ;)

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stclairdaniel picture stclairdaniel  路  3Comments

linuxhype picture linuxhype  路  3Comments

ccamusso picture ccamusso  路  3Comments

pbalzano91 picture pbalzano91  路  3Comments

cavr picture cavr  路  3Comments