Props: allowEditing const dataSource = [
{ id: '1', name: 'Documents', hasChild: true },
{ id: '2', pid: '1', name: 'Reports' },
{ id: '3', pid: '1', name: 'Invoices' }
];
<TreeViewComponent fields={ { dataSource: dataSource, id: 'id', text: 'name', parentID: 'pid', hasChildren: 'hasChild' } } allowEditing={true}></TreeViewComponent> | Props: editable const dataSource = [
{ id: '1', label: 'Documents' },
{ id: '2', parentId: '1', label: 'Reports' },
{ id: '3', parentId: '1', label: 'Invoices' }
];
<TreeView dataSource={dataSource} editable={true}></TreeView> | The allowEditing prop in EJ2 React is replaced with the editable prop in React. |
Props: allowMultiSelection const dataSource = [
{ id: '1', name: 'Documents', hasChild: true },
{ id: '2', pid: '1', name: 'Reports' },
{ id: '3', pid: '1', name: 'Invoices' }
];
<TreeViewComponent fields={ { dataSource: dataSource, id: 'id', text: 'name', parentID: 'pid', hasChildren: 'hasChild' } } allowMultiSelection={true}></TreeViewComponent> | Props: selectionMode const dataSource = [
{ id: '1', label: 'Documents' },
{ id: '2', parentId: '1', label: 'Reports' },
{ id: '3', parentId: '1', label: 'Invoices' }
];
<TreeView dataSource={dataSource} selectionMode='Multiple'></TreeView> | The allowMultiSelection prop in EJ2 React is replaced with the selectionMode prop set to 'Multiple' in React. |
Props: allowTextWrap const dataSource = [
{ id: '1', name: 'Documents', hasChild: true },
{ id: '2', pid: '1', name: 'Reports' },
{ id: '3', pid: '1', name: 'Invoices' }
];
<TreeViewComponent fields={ { dataSource: dataSource, id: 'id', text: 'name', parentID: 'pid', hasChildren: 'hasChild' } } allowTextWrap={true}></TreeViewComponent> | Props: textWrap const dataSource = [
{ id: '1', label: 'Documents' },
{ id: '2', parentId: '1', label: 'Reports' },
{ id: '3', parentId: '1', label: 'Invoices' }
];
<TreeView dataSource={dataSource} textWrap={true}></TreeView> | The allowTextWrap prop in EJ2 React is replaced with the textWrap prop in React. |
Props: autoCheck const dataSource = [
{ id: '1', name: 'Documents', hasChild: true, isChecked: true },
{ id: '2', pid: '1', name: 'Reports' },
{ id: '3', pid: '1', name: 'Invoices' }
];
<TreeViewComponent fields={ { dataSource: dataSource, id: 'id', text: 'name', parentID: 'pid', hasChildren: 'hasChild', isChecked: 'isChecked' } } showCheckBox={true} autoCheck={true}></TreeViewComponent> | Props: autoCheck const dataSource = [
{ id: '1', label: 'Documents', isChecked: true },
{ id: '2', parentId: '1', label: 'Reports' },
{ id: '3', parentId: '1', label: 'Invoices' }
];
<TreeView dataSource={dataSource} selectionMode='Checkbox' autoCheck={true}></TreeView> | The autoCheck prop is supported in both EJ2 React and React. |
Props: checkDisabledChildren const dataSource = [
{ id: '1', name: 'Documents', hasChild: true },
{ id: '2', pid: '1', name: 'Reports' },
{ id: '3', pid: '1', name: 'Invoices' }
];
<TreeViewComponent fields={ { dataSource: dataSource, id: 'id', text: 'name', parentID: 'pid', hasChildren: 'hasChild' } } showCheckBox={true} checkDisabledChildren={true}></TreeViewComponent> | Props: checkDisabledChildren const dataSource = [
{ id: '1', label: 'Documents' },
{ id: '2', parentId: '1', label: 'Reports' },
{ id: '3', parentId: '1', label: 'Invoices' }
];
<TreeView dataSource={dataSource} selectionMode='Checkbox' checkDisabledChildren={true}></TreeView> | The checkDisabledChildren prop is supported in both EJ2 React and React. |
Props: checkOnClick const dataSource = [
{ id: '1', name: 'Documents', hasChild: true },
{ id: '2', pid: '1', name: 'Reports' },
{ id: '3', pid: '1', name: 'Invoices' }
];
<TreeViewComponent fields={ { dataSource: dataSource, id: 'id', text: 'name', parentID: 'pid', hasChildren: 'hasChild' } } showCheckBox={true} checkOnClick={true}></TreeViewComponent> | Props: checkOnClick const dataSource = [
{ id: '1', label: 'Documents' },
{ id: '2', parentId: '1', label: 'Reports' },
{ id: '3', parentId: '1', label: 'Invoices' }
];
<TreeView dataSource={dataSource} selectionMode='Checkbox' checkOnClick={true}></TreeView> | The checkOnClick prop is supported in both EJ2 React and React. |
Props: cssClass const dataSource = [
{ id: '1', name: 'Documents', hasChild: true },
{ id: '2', pid: '1', name: 'Reports' },
{ id: '3', pid: '1', name: 'Invoices' }
];
<TreeViewComponent fields={ { dataSource: dataSource, id: 'id', text: 'name', parentID: 'pid', hasChildren: 'hasChild' } } cssClass='e-custom e-tree'></TreeViewComponent> | Props: className const dataSource = [
{ id: '1', label: 'Documents' },
{ id: '2', parentId: '1', label: 'Reports' },
{ id: '3', parentId: '1', label: 'Invoices' }
];
<TreeView dataSource={dataSource} className='custom-tree'></TreeView> | The cssClass prop in EJ2 React is replaced with the standard React className prop in React. |
Props: dataSource and fields const hierarchicalData = [
{ id: '1', name: 'Documents', hasChild: true },
{ id: '2', pid: '1', name: 'Reports' },
{ id: '3', pid: '1', name: 'Invoices' }
];
<TreeViewComponent fields={ { dataSource: hierarchicalData, id: 'id', text: 'name', parentID: 'pid', hasChildren: 'hasChild' } }></TreeViewComponent> | Props: dataSource and fields const dataSource = [
{ id: '1', label: 'Documents' },
{ id: '2', parentId: '1', label: 'Reports' },
{ id: '3', parentId: '1', label: 'Invoices' }
];
<TreeView dataSource={dataSource} fields={ { id: 'id', text: 'label', parentId: 'parentId' } }></TreeView> | The dataSource and fields props are supported in both EJ2 React and React. In React, the dataSource is moved from the fields configuration to the root level of the component, while fields only configures the mapping of datasource field names to Tree View fields. |
Props: disabled const dataSource = [
{ id: '1', name: 'Documents', hasChild: true },
{ id: '2', pid: '1', name: 'Reports' },
{ id: '3', pid: '1', name: 'Invoices' }
];
<TreeViewComponent fields={ { dataSource: dataSource, id: 'id', text: 'name', parentID: 'pid', hasChildren: 'hasChild' } } disabled={true}></TreeViewComponent> | Props: disabled const dataSource = [
{ id: '1', label: 'Documents' },
{ id: '2', parentId: '1', label: 'Reports' },
{ id: '3', parentId: '1', label: 'Invoices' }
];
<TreeView dataSource={dataSource} disabled={true}></TreeView> | The disabled prop is supported in both EJ2 React and React. |
Props: enableRtl const dataSource = [
{ id: '1', name: 'Documents', hasChild: true },
{ id: '2', pid: '1', name: 'Reports' },
{ id: '3', pid: '1', name: 'Invoices' }
];
<TreeViewComponent fields={ { dataSource: dataSource, id: 'id', text: 'name', parentID: 'pid', hasChildren: 'hasChild' } } enableRtl={true}></TreeViewComponent> | Props: dir const dataSource = [
{ id: '1', label: 'Documents' },
{ id: '2', parentId: '1', label: 'Reports' },
{ id: '3', parentId: '1', label: 'Invoices' }
];
<Provider dir='rtl'><TreeView dataSource={dataSource}></TreeView></Provider> | The enableRtl property in EJ2 React is replaced with the dir attribute in React, which is applied globally by wrapping the components in a Provider. |
Props: expandOn const dataSource = [
{ id: '1', name: 'Documents', hasChild: true },
{ id: '2', pid: '1', name: 'Reports' },
{ id: '3', pid: '1', name: 'Invoices' }
];
<TreeViewComponent fields={ { dataSource: dataSource, id: 'id', text: 'name', parentID: 'pid', hasChildren: 'hasChild' } } expandOn='Click'></TreeViewComponent> | Props: expandOn const dataSource = [
{ id: '1', label: 'Documents' },
{ id: '2', parentId: '1', label: 'Reports' },
{ id: '3', parentId: '1', label: 'Invoices' }
];
<TreeView dataSource={dataSource} expandOn='Click'></TreeView> | The expandOn prop is supported in both EJ2 React and React. |
Props: expandedNodes const dataSource = [
{ id: '1', name: 'Documents', hasChild: true },
{ id: '2', pid: '1', name: 'Reports' },
{ id: '3', pid: '1', name: 'Invoices' }
];
<TreeViewComponent fields={ { dataSource: dataSource, id: 'id', text: 'name', parentID: 'pid', hasChildren: 'hasChild' } } expandedNodes={['1']}></TreeViewComponent> | Props: defaultExpandedIds / expandedIds const dataSource = [
{ id: '1', label: 'Documents' },
{ id: '2', parentId: '1', label: 'Reports' },
{ id: '3', parentId: '1', label: 'Invoices' }
];
<TreeView dataSource={dataSource} defaultExpandedIds={['1']}></TreeView> | The expandedNodes prop in EJ2 React is replaced with the defaultExpandedIds and expandedIds props in React. |
Props: fullRowNavigable const dataSource = [
{ id: '1', name: 'Documents', hasChild: true, navigateUrl: '/documents' },
{ id: '2', pid: '1', name: 'Reports' },
{ id: '3', pid: '1', name: 'Invoices' }
];
<TreeViewComponent fields={ { dataSource: dataSource, id: 'id', text: 'name', parentID: 'pid', hasChildren: 'hasChild', navigateUrl: 'navigateUrl' } } fullRowNavigable={true}></TreeViewComponent> | Props: fullRowNavigable const dataSource = [
{ id: '1', label: 'Documents', navigateUrl: '/documents' },
{ id: '2', parentId: '1', label: 'Reports' },
{ id: '3', parentId: '1', label: 'Invoices' }
];
<TreeView dataSource={dataSource} fields={ { id: 'id', text: 'label', parentId: 'parentId', navigateUrl: 'navigateUrl' } } fullRowNavigable={true}></TreeView> | The fullRowNavigable prop is supported in both EJ2 React and React. |
Props: fullRowSelect const dataSource = [
{ id: '1', name: 'Documents', hasChild: true },
{ id: '2', pid: '1', name: 'Reports' },
{ id: '3', pid: '1', name: 'Invoices' }
];
<TreeViewComponent fields={ { dataSource: dataSource, id: 'id', text: 'name', parentID: 'pid', hasChildren: 'hasChild' } } fullRowSelect={true}></TreeViewComponent> | Props: fullRowSelect const dataSource = [
{ id: '1', label: 'Documents' },
{ id: '2', parentId: '1', label: 'Reports' },
{ id: '3', parentId: '1', label: 'Invoices' }
];
<TreeView dataSource={dataSource} fullRowSelect={true}></TreeView> | The fullRowSelect prop is supported in both EJ2 React and React. |
Props: height const dataSource = [
{ id: '1', name: 'Documents', hasChild: true },
{ id: '2', pid: '1', name: 'Reports' },
{ id: '3', pid: '1', name: 'Invoices' }
];
<TreeViewComponent fields={ { dataSource: dataSource, id: 'id', text: 'name', parentID: 'pid', hasChildren: 'hasChild' } } height='500px'></TreeViewComponent> | Props: style const dataSource = [
{ id: '1', label: 'Documents' },
{ id: '2', parentId: '1', label: 'Reports' },
{ id: '3', parentId: '1', label: 'Invoices' }
];
<TreeView dataSource={dataSource} style={ { height: '500px' } }></TreeView> | The height prop in EJ2 React is replaced with the standard React style prop in React, which accepts the height value through the height CSS property to control the fixed height of the Tree View container. |
Props: nodeTemplate const dataSource = [
{ id: '1', name: 'Documents', hasChild: true },
{ id: '2', pid: '1', name: 'Reports' },
{ id: '3', pid: '1', name: 'Invoices' }
];
const nodeTemplate = (data: any) => {
return <div><span className='e-treeview-icon'></span>{data.name}</div>;
};
<TreeViewComponent fields={ { dataSource: dataSource, id: 'id', text: 'name', parentID: 'pid', hasChildren: 'hasChild' } } nodeTemplate={nodeTemplate}></TreeViewComponent> | Props: JSX children composition import { TreeView, TreeViewNodes, TreeViewNode, TreeViewItemLabel } from '@syncfusion/react-navigations';
const data = [
{ id: '1', label: 'Documents' },
{ id: '2', label: 'Resume.docx' }
];
const fields = { id: 'id', label: 'label' };
<TreeView dataSource={data} fields={fields}>
<TreeViewNodes>
{(ctx) => (
<TreeViewNode>
<TreeViewItemLabel>{String((ctx.item as { label: string }).label)}</TreeViewItemLabel>
</TreeViewNode>
)}
</TreeViewNodes>
</TreeView> | The nodeTemplate prop in EJ2 React is replaced with a JSX composite pattern in React. Use the TreeViewNodes, TreeViewNode, TreeViewItemLabel, TreeviewLoadIcon, TreeViewItemToggle, TreeViewItemIcon, TreeViewItemCheckbox, TreeViewEditInput, and TreeViewEmptyState sub-components to render customized content for each node in the Tree View. |
Props: query const dataSource = new DataManager({ url: 'https://example.com/api/items', adaptor: new WebApiAdaptor, crossDomain: true });
const fields = { id: 'id', text: 'name', parentID: 'pid' };
const query = new Query().take(10).requiresCount();
<TreeViewComponent fields={ { dataSource: dataSource, id: 'id', text: 'name', parentID: 'pid' } } query={query}></TreeViewComponent> | Props: query const dataSource = new DataManager({ url: 'https://example.com/api/items', adaptor: new WebApiAdaptor, crossDomain: true });
const query = new Query().take(10).requiresCount();
<TreeView dataSource={dataSource} query={query}></TreeView> | The query prop is supported in both EJ2 React and React. |
Props: selectedNodes / checkedNodes const dataSource = [
{ id: '1', name: 'Documents', hasChild: true },
{ id: '2', pid: '1', name: 'Reports' },
{ id: '3', pid: '1', name: 'Invoices' }
];
<TreeViewComponent fields={ { dataSource: dataSource, id: 'id', text: 'name', parentID: 'pid', hasChildren: 'hasChild' } } selectedNodes={['2']} checkedNodes={['2']} showCheckBox={true}></TreeViewComponent> | Props: defaultSelectedIds / selectedIds const dataSource = [
{ id: '1', label: 'Documents' },
{ id: '2', parentId: '1', label: 'Reports' },
{ id: '3', parentId: '1', label: 'Invoices' }
];
<TreeView dataSource={dataSource} defaultSelectedIds={['2']}></TreeView> | The selectedNodes and checkedNodes props in EJ2 React are replaced with the defaultSelectedIds and selectedIds props in React. |
Props: showCheckBox const dataSource = [
{ id: '1', name: 'Documents', hasChild: true },
{ id: '2', pid: '1', name: 'Reports' },
{ id: '3', pid: '1', name: 'Invoices' }
];
<TreeViewComponent fields={ { dataSource: dataSource, id: 'id', text: 'name', parentID: 'pid', hasChildren: 'hasChild' } } showCheckBox={true}></TreeViewComponent> | Props: selectionMode const dataSource = [
{ id: '1', label: 'Documents' },
{ id: '2', parentId: '1', label: 'Reports' },
{ id: '3', parentId: '1', label: 'Invoices' }
];
<TreeView dataSource={dataSource} selectionMode='Checkbox'></TreeView> | The showCheckBox prop in EJ2 React is replaced with the selectionMode prop set to 'Checkbox' in React. |
Props: sortOrder const dataSource = [
{ id: '1', name: 'Documents', hasChild: true },
{ id: '2', pid: '1', name: 'Reports' },
{ id: '3', pid: '1', name: 'Invoices' }
];
<TreeViewComponent fields={ { dataSource: dataSource, id: 'id', text: 'name', parentID: 'pid', hasChildren: 'hasChild' } } sortOrder='Ascending'></TreeViewComponent> | Props: sortOrder const dataSource = [
{ id: '1', label: 'Documents' },
{ id: '2', parentId: '1', label: 'Reports' },
{ id: '3', parentId: '1', label: 'Invoices' }
];
<TreeView dataSource={dataSource} sortOrder='SortOrder.Ascending'></TreeView> | The sortOrder prop is supported in both EJ2 React and React. |