Coder Social home page Coder Social logo

react-kendo's Introduction

react-kendo

npm version Build status Dependency Status

React Component Library for Kendo UI Widgets. There exists a React Component named for every Kendo widget in the kendo.ui and kendo.ui.mobile namespaces. Tested on React 0.13 and KendoUI 2014.3.1411.

Install

$ npm install react-kendo --save
  <script src="http://cdn.kendostatic.com/2014.3.1411/js/kendo.all.min.js"></script>
  <link href='http://cdn.kendostatic.com/2014.3.1411/styles/kendo.common.min.css' rel='stylesheet'>
  <!-- and so forth... -->

Please note: Kendo Professional Components require a License.

Usage

var React = require('react');
var k = React.Kendo = require('react-kendo');

/**
 * Instead of, e.g.
 * $('#my-splitter').kendoSplitter(splitterOptions);
 */
var splitterOptions = {
  orientation: 'horizontal',
  panes: [
    { collapsible: false, size: '300px' },
    { resizable: true }
  ]
};
var treeOptions = { /* ... */ };
var gridOptions = { /* ... */ };

var Workstation = React.createClass({
  render: function () {
    return (
      <k.Splitter options={splitterOptions}>
        <k.TreeView options={treeOptions} />
        <k.Grid options={gridOptions} />
      </k.Splitter>
    );
  }
});

Properties

options

The main Kendo options object that is sent into the constructor. e.g. $('#my-splitter').kendoSplitter(options);

tag

The tag property specifies the html tag that the Kendo widget will be bound to. This is div by default, but can be set to any tag supported by React.

reactive

Version 0.13 and later support automatically re-initializing the Kendo Widget when the options property is updated. This is useful for re-loading Grids with new data, among other things. This is false by default.

debug

Set debug=true to log detailed information on the lifecycle events of your react-kendo component.

Additional Components

React.Kendo.Template

A React Component that represents a Kendo Template. Easily create a Kendo Template from a React Component. Additionally mixin React.Kendo.TemplateMixin.

var k = React.Kendo;
var MyListItem = React.createClass({
  mixins: [
    k.TemplateMixin
  ],
  render: function () {
    var item = this.props.item;
    return (
      <span>{item.title}</span>
    );
  }
});
var KendoList = React.createClass({
  render: function () {
    return (
      <k.ListView options={
        template: function (item) {
          return k.Template(<MyListItem item={item} />);
        }
      } />
    );
  }
});

Supplemental Functions

react-kendo also includes some extra functionality that isn't included in Kendo. These functions are added to the Kendo components via React mixins.

Grid.enableDraggableRows(group, options)

Invoke this function to make Grid rows draggable. This is not possible by default in the kendo-ui library.

var k = React.Kendo;
var KendoList = React.createClass({
  componentDidMount: function () {
    this.refs.grid.enableDraggableRows('myGroup', {
      drag: function (e) {
        // some custom stuff
      }
    });
  },
  render: function () {
    return (
      <k.Grid ref='grid' options={...} />
    );
  }
});

License

MIT

react-kendo's People

Contributors

tjwebb avatar chrismcv avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.