Skip to content

Adding ability to provide custom editors #532

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

Merged
merged 2 commits into from
Aug 6, 2016

Conversation

abhirao
Copy link
Contributor

@abhirao abhirao commented Jun 23, 2016

Addresses #162

  • This isn't ready to merge by any means. I got something working so I could wrap my brain around the problem. Now I'm wondering what the best interface could be. I believe I have a change that may not be backwards compatible - fieldValue is now being passed from TableBody to TableEditColumn as an attribute.
  • This is a working example:

cell_editing

- On a column you can specify customEditor - pass in a react component class
@AllenFang
Copy link
Owner

AllenFang commented Jun 26, 2016

@abhirao, it's seems look like good at first sight. Maybe can released on v3.0.0. How about it? or did you want to released in near future?

BTW, thanks your contribution

PropTypes.bool,
PropTypes.number,
PropTypes.object
])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AllenFang I'm not sure what the impact is of changing the fieldValue (which used to come in as children) from node to the 4 types I have listed.

@abhirao
Copy link
Contributor Author

abhirao commented Jul 5, 2016

@AllenFang Thank you very much for creating this library! Sorry I was traveling last week and didn't get a chance to respond to you.

I'm not sure what the timeline is for v3.0.0 but I think our team would like the custom cell editing sooner. I can definitely help with this.

@AllenFang
Copy link
Owner

@abhirao, that's awesome, I'll expect your contribution:) So I just keep this PR open and wait your confirm for completion.

BTW, if you complete this PR and if I almost finish v3.0.0, I'll release them together.

@abhirao
Copy link
Contributor Author

abhirao commented Jul 15, 2016

I analyzed the backwards compatibility of this PR and I think it should be fine. The only prop type that is changing is for editable columns for the field values.

My current implementation of custom editors is following a different pattern than custom filters. I'm going to do a little refactor to make the customEditor work the same way as filter.

- Need to pass in a factory method and custom properties
@abhirao
Copy link
Contributor Author

abhirao commented Jul 15, 2016

@AllenFang I've updated the interface for my custom editor implementation to match the custom filter interface.

Custom Editor:

<TableHeaderColumn dataField='price' dataFormat={ priceFormatter } customEditor={ { getElement: createPriceEditor, customEditorParameters: { currencies: currencies } } }> Product Price </TableHeaderColumn>

Custom Filter:

<TableHeaderColumn dataField='isInStock' filter={ { type: 'CustomFilter', getElement: getCustomFilter, customFilterParameters: { textOK: 'yes', textNOK: 'no' } } }>Product Is In Stock</TableHeaderColumn>

I think it's good to go. What do you think? Let me know if/how I can help with documentation.

@abhirao abhirao changed the title WIP: Adding ability to provide custom editors Adding ability to provide custom editors Jul 15, 2016
@AllenFang
Copy link
Owner

@abhirao, that's awesome :) I'll spend some time to review this PR. But need some time, it's busy in these day ;(

Anyway, you did a great job and thanks you!

@abhirao
Copy link
Contributor Author

abhirao commented Jul 18, 2016

@AllenFang You're welcome.

Thank you very much for all you do keep this project going 🙇 .

@AllenFang
Copy link
Owner

Just a passion on it to keep me to contribute this repo. I'm busy in the recent, but I think I can back in next month! Anyway, if u r interesting for contributing this repo at long term, welcome to discuss with me :)

@AllenFang AllenFang merged commit b162b52 into AllenFang:master Aug 6, 2016
@AllenFang
Copy link
Owner

AllenFang commented Aug 6, 2016

@abhirao, I need to say thanks again. This PR has been released on v2.4.0. Thanks you :) That's awesome!

@abhirao abhirao deleted the custom_cell_editors branch August 21, 2016 14:43
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

Successfully merging this pull request may close these issues.

2 participants