Kendo UI DropDowns for React
Перейти к файлу
Dimitar Terziev 3287e4a693
docs: update README
2018-04-11 15:31:26 +03:00
docs docs(combobox): add link to npm package 2016-08-10 13:19:48 +03:00
e2e chore: remove AutoComplete component 2016-05-04 11:23:09 +03:00
examples docs(combobox): Update examples 2016-05-18 14:55:09 +03:00
src chore(util): extract util methods in kendo-dropdowns-common package 2016-07-20 13:45:43 +03:00
test chore(util): extract util methods in kendo-dropdowns-common package 2016-07-20 13:45:43 +03:00
.eslintrc.json chore(eslint): Disable react/jsx-sort-props rule 2016-04-26 14:26:42 +03:00
.gitignore chore: update gitignore and npmignore files 2016-05-03 16:42:24 +03:00
.npmignore chore: prepare for npm release 2016-06-09 16:33:23 +03:00
.travis.yml chore: add travis configuration 2016-06-09 16:56:58 +03:00
CHANGELOG.md chore: bump version 2016-06-13 10:22:04 +03:00
LICENSE.md docs: Add LICENSE and update README to initial draft version 2016-03-31 11:57:27 +03:00
README.md docs: update README 2018-04-11 15:31:26 +03:00
gulpfile.js feat(list): Initial list implementation 2016-02-11 18:55:21 +02:00
package.json chore(util): extract util methods in kendo-dropdowns-common package 2016-07-20 13:45:43 +03:00

README.md

Commitizen friendly npm version Build Status

This package is now deprecated and has been archived. For the current version of the Kendo UI DropDowns for React, refer to the official website

Kendo UI DropDowns for React

Overview

This repository contains the source code and documentation of the Kendo UI DropDowns package for React.

Currently, it includes the following components:

  • ComboBox
  • DropDownList

We are working on porting the ones listed below too:

  • AutoComplete
  • MultiSelect

Basic Usage

Kendo UI ComboBox

The ComboBox displays a list of pre-defined options. It allows the user to pick a single value from it, or to enter a custom value through keyboard input.

    <div id="app"></div>
    class ComboBoxContainer extends React.Component {
        constructor(props) {
            super(props);
            this.state = {
                data: [
                    { text: "Foo", value: 1 },
                    { text: "Bar", value: 2 },
                    { text: "Baz", value: 3 }
                ],
                value: null,
                filter: null
            }
        }

        onChange = (value) => {
            this.setState({
                value: value,
                filter: null
            });
        }

        onFilter = (text) => {
            let result = [];
            if (text) {
                result = data.filter(function(item) {
                    return item.text.toLowerCase().startsWith(text.toLowerCase());
                });
            } else {
                result = data;
            }

            this.setState({
                data:result,
                filter: text
            });
        }

        render() {
            return(
                <KendoReactDropdowns.ComboBox
                    data={this.state.data}
                    filter={this.state.filter}
                    placeholder="search..."
                    onChange={this.onChange}
                    onFilter={this.onFilter}
                    textField="text"
                    value={this.state.value}
                    valueField="value"
                />
            )
        }
    }

    ReactDOM.render(
        <ComboBoxContainer />,
        document.getElementById('app')
    );

For more examples and available configuration options, refer to the ComboBox documentation.

Kendo UI DropDownList

The DropDownList displays a list of pre-defined options and allows the user to pick a single value from it.

    <div id="app"></div>
    class DropDownListContainer extends React.Component {
        constructor(props) {
            super(props);
            this.state = {
                data: [
                    { text: "Foo", value: 1 },
                    { text: "Bar", value: 2 },
                    { text: "Baz", value: 3 }
                ],
                value: null
            }
        }

        onChange = (value) => {
            this.setState({
                value: value
            });
        }

        render() {
            return(
                <KendoReactDropdowns.DropDownList
                    data={this.state.data}
                    defaultItem={{ text: "Select...", value: null }}
                    onChange={this.onChange}
                    textField="text"
                    value={this.state.value}
                    valueField="value"
                />
            )
        }
    }

    ReactDOM.render(
        <DropDownListContainer />,
        document.getElementById('app')
    );

For more examples and available configuration options, refer to the DropDownList documentation.

Installation

As of the latest release, the DropDowns have not been published as a public scoped NPM package yet. The team are working on doing so shortly.

Browser Support

The DropDowns work in all browsers supported by the React framework—Internet Explorer 9 and later versions.

Glossary

Below are explained the basic terms the suite for React applies.

Component

A Component refers to a React Component.

Package

A package contains one or more components, developed in a single repository and distributed in a single NPM package. For example, the AutoComplete, ComboBox, and DropDownList components for React are part of the DropDowns Package.