Skip to content

addDetailsItem #4459

Answered by ebonow
MohsenEs asked this question in Q&A
Feb 23, 2021 · 1 comments · 5 replies
Discussion options

You must be logged in to vote

(Converted from issues to discussion)

The prop you are likely looking for is formatOptionLabel to render JSX for your option.

const formatOptionLabel = (option, { context }) => {
  return context === 'menu' ? 
    (<div>
      <div>{option.id}</div>
      <div>{option.description}</div>
      <div>{option.product}</div>
    <div>
  ) : option.label
}

return <Select formatOptionLabel={formatOptionLabel} {...otherProps} />

To search on any of the fields, you can modify the filterOptions. There are a few custom options you can use to modify how the filtering is done. In this case, you would want to use createFilter and pass in a stringify function which takes all of the data you want to sea…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@ebonow
Comment options

@MohsenEs
Comment options

@ebonow
Comment options

@ebonow
Comment options

@ebonow
Comment options

Answer selected by ebonow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #4458 on February 23, 2021 19:29.