• What is KendoReact
  • Getting Started
  • Server Components
  • Components
    • Animation
    • Barcodes
    • Buttons
    • Chartsupdated
    • Common Utilities
    • Conversational UIupdated
    • Data Gridupdated
    • Data Query
    • Data Tools
    • Date Inputs
    • Date Math
    • Dialogs
    • Drawing
    • Dropdownsupdated
    • Editor
    • Excel Export
    • File Saver
    • Formupdated
    • Ganttupdated
    • Gauges
    • Indicators
    • Inputsupdated
    • Labels
    • Layoutupdated
    • ListBox
    • ListView
    • Map
    • Notification
    • OrgChartnew
    • PDF Processing
    • PDFViewer
    • PivotGrid
    • Popup
    • Progress Bars
    • Ripple
    • Scheduler
    • ScrollView
    • Sortable
    • Spreadsheetupdated
    • TaskBoard
    • Tooltips
    • TreeList
    • TreeViewupdated
    • Upload
  • Sample Applications
  • Styling & Themes
  • Common Features
  • Project Setup
  • Knowledge Base
  • Changelog
  • Updates
  • Troubleshooting

MultiSelectTree

Represents the MultiSelectTree component.

Accepts properties of type MultiSelectTreeProps. Obtaining the MultiSelectTreeHandle.

A Functional Component.

  const dataItemKey = 'id';
  const checkField = 'checkField';
  const checkIndeterminateField = 'checkIndeterminateField';
  const subItemsField = 'items';
  const expandField = 'expanded';
  const textField = 'text';
  const fields = {
   dataItemKey,
   checkField,
   checkIndeterminateField,
   expandField,
   subItemsField,
  };
  const App = () => {
   const [value, setValue] = React.useState([]);
   const [expanded, setExpanded] = React.useState([data[0][dataItemKey]]);
   const onChange = (event) =>
      setValue(
      getMultiSelectTreeValue(data, {
          ...fields,
          ...event,
          value,
      })
      );
  const onExpandChange = React.useCallback(
      (event) => setExpanded(expandedState(event.item, dataItemKey, expanded)),
      [expanded]
  );
  const treeData = React.useMemo(
      () =>
      processMultiSelectTreeData(data, {
          expanded,
          value,
          ...fields,
      }),
      [expanded, value]
  );

  return (
      <div>
      <div>Categories:</div>
      <MultiSelectTree
          style={{
          width: '300px',
          }}
          data={treeData}
          value={value}
          onChange={onChange}
          placeholder="Please select ..."
          textField={textField}
          dataItemKey={dataItemKey}
          checkField={checkField}
          checkIndeterminateField={checkIndeterminateField}
          expandField={expandField}
          subItemsField={subItemsField}
          onExpandChange={onExpandChange}
      />
      </div>
  );
  };
  ReactDOM.render(<App />, document.querySelector('my-app'));
NameTypeDefaultDescription

props

MultiSelectTreeProps intersected with RefAttributes<undefined>

The props of the MultiSelectTree component.

In this article

Not finding the help you need?