How to use the react-sortable-tree.getFlatDataFromTree function in react-sortable-tree

To help you get started, we’ve selected a few react-sortable-tree examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apjs / ReactVelocity / src / components / tree.js View on Github external
createCodeForGenerateContent() {
    const getNodeKey = ({ treeIndex }) => treeIndex;
    const flatteningNestedArray = getFlatDataFromTree({treeData: this.state.treeData, getNodeKey});
    let flattenedVar = flatteningNestedArray;
    // console.log('theprops ' + this.props.flattenedArray)
    let version1 = [];
    let version2 = {};
    for(let i = 0; i
github apjs / ReactVelocity / src / components / tree.js View on Github external
render() {
    console.log(this.state.parents)
    const getNodeKey = ({ treeIndex }) => treeIndex;
    const flatteningNestedArray = getFlatDataFromTree({treeData: this.state.treeData, getNodeKey});
    let flattenedVar = flatteningNestedArray;
    // console.log('theprops ' + this.props.flattenedArray)
    let version1 = [];
    let version2 = {};
    for(let i = 0; i
github apjs / ReactVelocity / src / components / react-tree.js View on Github external
createCodeForGenerateContent() {
    const getNodeKey = ({ treeIndex }) => treeIndex;
    const flatteningNestedArray = getFlatDataFromTree({treeData: this.state.treeData, getNodeKey});
    let flattenedVar = flatteningNestedArray;
/*
  version1 is an array of sub-arrays. Within each array, the last element
  is the parent of all previous elements.
 */
    let version1 = [];
  /* For version2, the key is the parent. Value is all of the children
    stored as elements in an array.
  */
    let version2 = {};

    for(let i = 0; i
github apjs / ReactVelocity / src / components / tree.js View on Github external
createParents() {
    const getNodeKey = ({ treeIndex }) => treeIndex;
    const flatteningNestedArray = getFlatDataFromTree({treeData: this.state.treeData, getNodeKey});
    const flattenedArray = flatteningNestedArray.map(ele => {
      return ele.node.title
    });
    const parents = flattenedArray.map((parent, index) => {
      return <menuitem value="{index}">
    });
    this.setState({parents: parents});
  }
</menuitem>
github apjs / ReactVelocity / src / components / tree.js View on Github external
updateFlattenedData() {
    const getNodeKey = ({ treeIndex }) => treeIndex;
    const flatteningNestedArray = getFlatDataFromTree({treeData: this.state.treeData, getNodeKey});
    const flattenedArray = flatteningNestedArray.map(ele => {
      return ele.node.title
    });
    this.setState(state => ({
      flattenedData: flattenedArray,
      flattenedArray: flatteningNestedArray,
      textFieldValue: '',
    }))
  }
github apjs / ReactVelocity / src / components / react-tree.js View on Github external
updateFlattenedData() {
    const getNodeKey = ({ treeIndex }) => treeIndex;
    const flatteningNestedArray = getFlatDataFromTree({treeData: this.state.treeData, getNodeKey});
    this.setState(state => ({
      flattenedArray: flatteningNestedArray,
      textFieldValue: '',
    }))
  }
github apjs / ReactVelocity / src / components / redux-tree.js View on Github external
updateFlattenedData() {
    const getNodeKey = ({ treeIndex }) => treeIndex;
    const flatteningNestedArray = getFlatDataFromTree({treeData: this.state.treeData, getNodeKey});
    this.setState(state => ({
      flattenedArray: flatteningNestedArray,
      actionName: '',
      actionType: '',
      reducerName: '',
      reducerCase: '',
      componentName: '',
      containerName: '',
    }))
  }