Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.

Add visibleItems() method #219

Open
wants to merge 46 commits into
base: master
Choose a base branch
from
Open

Add visibleItems() method #219

wants to merge 46 commits into from

Conversation

wmertens
Copy link

@wmertens wmertens commented Dec 2, 2015

Returns an array of data objects that are currently visible, handy to implement item selection / mark as read etc.

Simply keep a ref to the table to use it. It uses, in order, the props "i", "id" or the key to allow the user to provide ids for the table rows.

Not sure if the test setup suits your tastes?

returns an array of data objects that are currently visible, handy to implement item selection / mark as read etc
const {i, id} = item.props;
const iOrId = i != null ? i : id;
const idOrKey = iOrId != null ? iOrId : item.key;
const data = {id: idOrKey};
Copy link
Owner

Choose a reason for hiding this comment

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

I'd prefer to keep these using let

@glittershark
Copy link
Owner

Small nit, plus squash these two commits, keep everything squashed to one commit, and rebase, and this is good to go.

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

Successfully merging this pull request may close these issues.

4 participants