Skip to content

Add a callback for when the selected items are changed? #218

Description

@tgolen

In order for code to react appropriately to a change in the selectedIds array, I feel it is necessary to add an optional callback to the options called onSelectionChange. This would be a callback that is passed the current array of selectedIds and triggered from _toggleSelectAll() and _toggleSelectRow().

I was not able to find any way of getting the selectedIds, but if I missed it for some reason, please point me to it.

Example usage:
When the selected items are changed, disable/enable a button depending on if you have any items selected or not.

if (this.props.onSelectionChange !== null && _.isFunction(this.props.onSelectionChange)) {
    this.props.onSelectionChange(newSelectedRowIds);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions