ChoiceGroup


import * as React from 'react';  
import { ChoiceGroup, IChoiceGroupOption } from 'office-ui-fabric-react/lib/ChoiceGroup';

export interface IChoiceGroupBasicExampleState {
  imageKey: string;
}

export class ChoiceGroupBasicExample extends React.Component<any, IChoiceGroupBasicExampleState> {
  constructor() {
    super();

    this.state = {
      imageKey: ''
    };
  }

  render() {
    return (
      <div>
        <ChoiceGroup
          defaultSelectedKey='B'
          options={ [
            {
              key: 'A',
              text: 'Option B',
            },
            {
              key: 'B',
              text: 'Option B',
            },
            {
              key: 'C',
              text: 'Option C',
            },
            {
              key: 'D',
             text: 'Option D',
              disabled: true
            }
          ] }
          onChange={ this._onChange }
          label='Pick one'
          required={ true }
        />
      </div>
    );
  }

  _onChange(ev: React.FormEvent<HTMLInputElement>, option: any) {
    console.dir(option);
  }
}


© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited TopPrevNext