-
Notifications
You must be signed in to change notification settings - Fork 165
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
Row select and customized row select with prop feature. #39
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the PR looks promising, but I'd say I didn't include selection feature to BaseTable
on purpose, as there are different behaviors for that, and I want to keep BaseTable
unopinionated, for example:
- should we show a
indeterminate
for the header's checkbox if partial is selected - as we support tree data, should we select all the children if the parent is selected, I'll tell you we don't in our advanced table
- how to sync the staled keys if those rows are removed
We addressed those questions in our advanced table component based on BaseTable
with our own behavior definition, see the screenshot here https://github.com/Autodesk/react-base-table#example
I'd prefer if we only add a example to demo the feature, I'll add a recipe for that, hope we could support it via plugin in the future
@@ -49,13 +49,14 @@ class BaseTable extends React.PureComponent { | |||
constructor(props) { | |||
super(props); | |||
|
|||
const { columns, children, expandedRowKeys, defaultExpandedRowKeys } = props; | |||
const { columns, children, expandedRowKeys, defaultExpandedRowKeys, selectedRowKeys } = props; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there should be uncontrolled defaultSelectedRowKeys
as well
/** | ||
* Selected row data key | ||
*/ | ||
selectedRowKey: PropTypes.string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is unnecessary, should be the same as rowKey
/** | ||
* Selected row keys when initialize the table | ||
*/ | ||
selectedRowKeys: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string])), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the rowKey
could be number
now
Hi, @nihgwu |
@berkayakcay sure, I'll add a demo before we could support that via plugin BTW, I'd like to share the APIs I'm using for selection feature |
@nihgwu We want to clarify that you shared API's are available for your local brach. We couldn't see these API's on code base. Did you share your own API on your code base or you share these image to guide us while completing PR. |
I’ll share this feature as a demo, I shared the api here for early preview or as a guide
Btw that’s not a local branch but a high level component built on BaseTable and used in many products, as I explained before that includes some internal code which is not ready for open source
On May 27, 2019, at 19:10, Erdem BAS <[email protected]<mailto:[email protected]>> wrote:
@nihgwu<https://github.com/nihgwu> We want to clarify that you shared API's are available for your local brach. We couldn't see these API's on code base. Did you share your own API on your code base or you share these image to guide us while completing PR.
What should we do?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#39?email_source=notifications&email_token=AATZR4WYQQ6Q7ULY3TS4QJ3PXO6STA5CNFSM4HPSKUUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWJQWBI#issuecomment-496175877>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AATZR4XEPQEA46ZWWA2AJLTPXO6STANCNFSM4HPSKUUA>.
|
We decided to obey your suggestion. We create HOC and use a custom component. We will wait for "plugin support" #3 |
hi @erdembas @berkayakcay, I've add a demo for selection feature, sorry for the long wait |
Our purpose of this pull request is to enable row select with pros.
Please review the PR.
We need your feedback to continue forward steps. Documentation, roadmap..
Our roadmap;
we want to make more flexable row select.