Home Reference Source Repository
import PersonPicker from 'ntnu-react/material/PersonPicker.js'
public class | source

PersonPicker

Extends:

react~React.Component → PersonPicker

AutoComplete search for person. Display selected as a Chip.

Example:

<PersonPicker
    floatingLabelText="Contact"
    floatingLabelFiexed={true}
    value={{key: 'billyga@ntnu.no', text: 'Billy Gates', avatar: 'https://some.url/to/picture'}}
    onChange={this.handleChange}
    onSearch={this.handleSearch}
/>

Static Member Summary

Static Public Members
public static
public static

Member Summary

Public Members
public
public
public
public
public

Method Summary

Public Methods
public
public

render(): Node

Static Public Members

public static contextTypes: Object source

public static propTypes: Object source

Properties:

NameTypeAttributeDescription
fullWidth boolean
disabled boolean
wrapStyle Object
floatingLabelText string
floatingLabelFixed boolean
value {key: string, text: string, avatar: ?string}

Set a person

onChange function(selected: {key: string, text: string, avatar: ?string})

Callback when a person is selected.

onSearch function(searchText: string): Promise<Object[]>

List of {key: string, text: string, avatar: ?string} objects.

Public Members

public handleDelete: function source

public handleNewRequest: function source

public handleUpdateInput: function source

public onChangeCallback: function source

public state: Object source

Public Methods

public componentWillReceiveProps(nextProps: *) source

Params:

NameTypeAttributeDescription
nextProps *

public render(): Node source

Return:

Node