msupply-foundation / react-native-data-table

154 stars 35 forks source link

Removes realm from dependencies, adds scrollable prop to DataTable and arrowStyle to HeaderCell #5

Closed JulianKingman closed 6 years ago

JulianKingman commented 7 years ago
edmofro commented 7 years ago

Thanks for your contribution @JulianKingman! The horizontal scrolling is great. Unfortunately we can't merge this as is, as internally we need to use the Realm ListView for optimisations like lazy loading data into the table. If you can work on creating a dependency injection setup it would be much appreciated, otherwise we will leave this sitting open until one of us gets a chance.

JulianKingman commented 7 years ago

I'm not sure if this is the right way to do it, but I added a listViewComponent prop to DataTable where you can pass in any ListView you like.

<DataTable
    dataSource={listviewData}
    listViewComponent={RealmListView}
    style={style.table}
    scrollable={scrollable}
    ...
/>
edmofro commented 7 years ago

Thanks, I reckon that'll work just fine. Will test and merge when we find time.

edmofro commented 7 years ago

By the way, if you're interested in this component, you might want to check out https://github.com/sussol/react-native-generic-table-page for a view that has this table integrated with a search bar and some sensible defaults.

Chris-Petty commented 7 years ago

I'm suddenly feeling the burden of not having automated tests...

Chris-Petty commented 6 years ago

Ancient.

Chris-Petty commented 6 years ago

At least it would be a good step forward, but ListView is well deprecated now anyway.