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

Support of Object Type #2

Closed
gtsluk opened this issue Aug 19, 2018 · 4 comments
Closed

Support of Object Type #2

gtsluk opened this issue Aug 19, 2018 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@gtsluk
Copy link

gtsluk commented Aug 19, 2018

Can support Object rather than single value ?
For Example
Object.label used for display on the flatlist
Object.id is the key

@ayushnawani
Copy link
Owner

ayushnawani commented Aug 19, 2018

Hi @gtsluk,
Are you suggesting for the main list which we are displaying? I will look into this for sending the object data.

@ayushnawani
Copy link
Owner

ayushnawani commented Aug 19, 2018

Hey @gtsluk,
I have added a new props matchFieldName using which you can define the name of the field to match with letters.

Latest changes are pushed into dev branch, You can try dev branch code and let me know whether it working for you or not.

Example: For data like

const testData =  [{
    label: 'kabel1',
    id: 1,
  },
  {
    label: 'label2',
    id: 2,
  },
  {
    label: 'label3',
    id: 3,
  }]

Pass matchFieldName in AlphabetFlatList like this

        <AlphabetFlatList
          renderItem={this.renderItem}
          ListHeaderComponent={this.renderHeader}
          ListFooterComponent={this.renderFooter}
          data={testData}
          getItemLayout={this.getItemLayout}
          keyExtractor={(item, index) => {
            return item.id;
          }}
          matchFieldName="label" // define the field name to match with letter
        />

@ayushnawani ayushnawani added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Aug 19, 2018
@gtsluk
Copy link
Author

gtsluk commented Aug 22, 2018

it works. Thanks

ayushnawani added a commit that referenced this issue Aug 26, 2018
@ayushnawani
Copy link
Owner

Great. I have released new version v1.0.4 with these changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants