Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always "on" dataEditor #132

Open
Emsu opened this issue Nov 9, 2018 · 4 comments
Open

Always "on" dataEditor #132

Emsu opened this issue Nov 9, 2018 · 4 comments

Comments

@Emsu
Copy link

Emsu commented Nov 9, 2018

I'm trying to setup a checkbox as a dataEditor but then I realized since it's either true of false, I should just always show the checkbox and there should be no value viewer vs data editor since the user wouldn't want to click into the cell to go to edit mode and would prefer to toggle the value directly.

forceComponent and component doesn't pass the onChange prop (and I saw in another issue that it's getting deprecated). Is there a way to force dataEditor or another solution?

@shawnmitchell
Copy link
Contributor

I got a checkbox column working by using the cell properties component and forceComponent

@Emsu
Copy link
Author

Emsu commented Nov 11, 2018

@shawnmitchell Do you mind sharing how? Because you don't get props passed into the component as you do in valueViewer and dataEditor, it seems like I'll need to hack an onChange hook into the component. Also fyi, I saw in another thread that forceComponent and component are intended to be deprecated.

@shawnmitchell
Copy link
Contributor

I did indeed hack away at it.

cell.component = (
       <MyCheckbox
          onChange={handleCellChange}
          row={i}
          col={j}
          value={value}
      />
  );

It would be better to be able to forceEditor, I agree.

@sibelius
Copy link

sibelius commented Apr 3, 2019

I think we need to pass onChange to valueViewer to make this work well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants