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

[ListView.DataSource] Comprehensive documentation & Sorting/Grouping #1880

Closed
yelled3 opened this issue Jul 6, 2015 · 10 comments
Closed

[ListView.DataSource] Comprehensive documentation & Sorting/Grouping #1880

yelled3 opened this issue Jul 6, 2015 · 10 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@yelled3
Copy link
Contributor

yelled3 commented Jul 6, 2015

I was trying to understand how to work with ListView.DataSource;

one of the key use case that I was interested in is sorting;
my list is a collection of names, grouped by first letter:

A:
  Adam,
  Amy,
B:
  Ben,
  Bob
...

where should the sorting and grouping logic be?
assuming I want to keep the list sorted and be able to add/remove rows.

the docs offered very little guidance:
http://facebook.github.io/react-native/docs/listview.html#datasource

aside from the code example: http://facebook.github.io/react-native/docs/listview.html#examples
there was nothing really in the docs about the ListView.DataSource.

the only thing close to a documentation, that I was able to find, was in the source:
https://github.com/facebook/react-native/blob/master/Libraries/CustomComponents/ListView/ListViewDataSource.js

another source that helped was:
http://www.reactnative.com/react-native-tutorial-for-creating-listview-with-section-headers/

but again, it was fairly limited.

so, I would like to suggest that ListView.DataSource be added to the docs (as a page of it's own)
and include a few examples.
also, I think this a very common use case and should probably be included in the docs.

@octatone
Copy link

👍

The react-native abstractions around ListView and the accompanying data source, are very hard to reason about when provided with zero documentation.

@akabab
Copy link

akabab commented Aug 4, 2015

+1!

@yelled3
Copy link
Contributor Author

yelled3 commented Aug 4, 2015

@ide @brentvatne /cc

@christopherdro
Copy link
Contributor

These examples should help anybody having trouble understanding how to deal ListView's dataSource.

Rows: https://rnplay.org/apps/d3DM6A
Rows with Sections: https://rnplay.org/apps/xnyaYw

@brentvatne You can maybe take a look at these examples. If they are good enough you can maybe fork them over to the account for the examples and link them inside the docs.

@brentvatne brentvatne self-assigned this Sep 13, 2015
@mark0978
Copy link

I'm going to say these don't help much more than the tutorial which doesn't show me anything but how to use a simple case of the datasource. Maybe the datasource has no other features......

Perhaps if you need more info, you could look at this https://github.com/facebook/react-native/blob/master/Libraries/CustomComponents/ListView/ListViewDataSource.js instead

@satya164
Copy link
Contributor

Duplicate of #410

@JO-WTF
Copy link

JO-WTF commented May 25, 2016

@christopherdro I have to say those examples are brilliant!

That solved my questions!

Thank you very much!!!

@JO-WTF
Copy link

JO-WTF commented May 25, 2016

@christopherdro Well, it's a shame that I cannot copy the code from there though.

@christopherdro
Copy link
Contributor

@JO-WTF You can fork that example into your own account.

@JO-WTF
Copy link

JO-WTF commented May 25, 2016

@christopherdro It's alright. I got the idea, that's the point :)

Thanks a lot. You have been really helpful.

@facebook facebook locked as resolved and limited conversation to collaborators Jul 22, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

9 participants