<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Tree control Collapse/Expand in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/tree-control-collapse-expand/m-p/1394151#M11502</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was trying to use List Tree Control, but the collapse expand is not working when i try to implement in the widget, I copied code from this article&amp;nbsp;&lt;A href="https://developers.arcgis.com/experience-builder/storybook/?path=/docs/components-jimu-ui-basic-list-tree-tree--docs" target="_blank"&gt;https://developers.arcgis.com/experience-builder/storybook/?path=/docs/components-jimu-ui-basic-list-tree-tree--docs&lt;/A&gt;&amp;nbsp;but expand collapse doesn't work, I tried this on developer edition 1.10, 1.13 but it's not working&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RachappaBellappa1_0-1710171547596.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/97557i6A22133317FDCD27/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RachappaBellappa1_0-1710171547596.png" alt="RachappaBellappa1_0-1710171547596.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Mar 2024 15:39:41 GMT</pubDate>
    <dc:creator>RachappaBellappa1</dc:creator>
    <dc:date>2024-03-11T15:39:41Z</dc:date>
    <item>
      <title>Tree control Collapse/Expand</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/tree-control-collapse-expand/m-p/1394151#M11502</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was trying to use List Tree Control, but the collapse expand is not working when i try to implement in the widget, I copied code from this article&amp;nbsp;&lt;A href="https://developers.arcgis.com/experience-builder/storybook/?path=/docs/components-jimu-ui-basic-list-tree-tree--docs" target="_blank"&gt;https://developers.arcgis.com/experience-builder/storybook/?path=/docs/components-jimu-ui-basic-list-tree-tree--docs&lt;/A&gt;&amp;nbsp;but expand collapse doesn't work, I tried this on developer edition 1.10, 1.13 but it's not working&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RachappaBellappa1_0-1710171547596.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/97557i6A22133317FDCD27/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RachappaBellappa1_0-1710171547596.png" alt="RachappaBellappa1_0-1710171547596.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2024 15:39:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/tree-control-collapse-expand/m-p/1394151#M11502</guid>
      <dc:creator>RachappaBellappa1</dc:creator>
      <dc:date>2024-03-11T15:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: Tree control Collapse/Expand</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/tree-control-collapse-expand/m-p/1394356#M11515</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/124928"&gt;@Jianxia&lt;/a&gt;&amp;nbsp;any thoughts?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2024 20:15:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/tree-control-collapse-expand/m-p/1394356#M11515</guid>
      <dc:creator>RachappaBellappa1</dc:creator>
      <dc:date>2024-03-11T20:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: Tree control Collapse/Expand</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/tree-control-collapse-expand/m-p/1394466#M11519</link>
      <description>&lt;P&gt;Could you please share the snippet of how you use the component so that we can further investigate? Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 01:28:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/tree-control-collapse-expand/m-p/1394466#M11519</guid>
      <dc:creator>TianWen</dc:creator>
      <dc:date>2024-03-12T01:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: Tree control Collapse/Expand</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/tree-control-collapse-expand/m-p/1394654#M11534</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/160487"&gt;@TianWen&lt;/a&gt;&amp;nbsp;I just copied the code snippet from storybook example and placed it inside the sample widget code. Please check the below screenshot&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RachappaBellappa1_0-1710254189896.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/97707i57364EE702CCFDB0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RachappaBellappa1_0-1710254189896.png" alt="RachappaBellappa1_0-1710254189896.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 14:37:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/tree-control-collapse-expand/m-p/1394654#M11534</guid>
      <dc:creator>RachappaBellappa1</dc:creator>
      <dc:date>2024-03-12T14:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: Tree control Collapse/Expand</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/tree-control-collapse-expand/m-p/1395136#M11554</link>
      <description>&lt;P&gt;Thanks for the screenshot!&lt;/P&gt;&lt;P&gt;1. The tree component is driven by data, and you can set default data initially.&lt;/P&gt;&lt;P&gt;2. Any interactions with the component will generate updated data, which will be returned via the update function.&lt;/P&gt;&lt;P&gt;You will then need to pass this updated data back to the component.&lt;/P&gt;&lt;P&gt;Please refer to the snippet below for details.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TianWen_0-1710320968174.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/97840i8AAA236DC0329695/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TianWen_0-1710320968174.png" alt="TianWen_0-1710320968174.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import { React, type AllWidgetProps } from 'jimu-core'
import { type IMConfig } from '../config'
import { Tree, TreeAlignmentType, TreeCollapseStyle, TreeStyle } from 'jimu-ui/basic/list-tree'

const Widget = (props: AllWidgetProps&amp;lt;IMConfig&amp;gt;) =&amp;gt; {
  const getItemsJson = () =&amp;gt; {
    const myCommands = [
      {
        label: 'Edit',
        iconProps: () =&amp;gt; ({ icon: require('jimu-icons/svg/outlined/editor/edit.svg') }),
        action: (options) =&amp;gt; { alert(`Edit fired for item: ${JSON.stringify(options.data.itemJsons, null, 2)}`) }
      }
    ]
    return {
      itemKey: 'root item for tree data entry',
      itemStateTitle: 'root item for tree data entry',
      itemChildren: [
        {
          itemKey: 'dummy entity 1',
          itemStateTitle: 'dummy entity 1',
          isItemSelectable: true,
          itemStateChecked: true,
          itemStateCommands: myCommands,
          itemStateDetailContent: JSON.stringify({ itemStateCommands: myCommands.map(i =&amp;gt; i.label) }),
          itemStateIcon: () =&amp;gt; ({ icon: require('jimu-icons/svg/outlined/gis/map.svg') })
        },
        {
          itemKey: 'dummy entity 2',
          itemStateTitle: 'dummy entity 2',
          itemStateExpanded: true,
          itemStateCommands: myCommands.slice(1),
          itemStateDetailContent: JSON.stringify({ itemStateCommands: myCommands.slice(1).map(i =&amp;gt; i.label) }),
          itemStateIcon: () =&amp;gt; ({ icon: require('jimu-icons/svg/outlined/gis/map.svg') }),
          itemChildren: [
            {
              itemKey: 'dummy entity 2.1',
              itemStateTitle: 'dummy entity 2.1',
              itemChildren: [
                {
                  itemKey: 'dummy entity 2.1.1',
                  itemStateTitle: 'dummy entity 2.1.1',
                  itemStateCommands: myCommands.slice(1)
                },
                {
                  itemKey: 'dummy entity 2.1.2',
                  itemStateTitle: 'dummy entity 2.1.2'
                }
              ]
            },
            {
              itemKey: 'dummy entity 2.2',
              itemStateTitle: 'dummy entity 2.2 (isItemSelectable = false)',
              isItemSelectable: false,
              itemChildren: [
                {
                  itemKey: 'dummy entity 2.2.1',
                  itemStateTitle: 'dummy entity 2.2.1'
                }
              ]
            }
          ]
        }
      ]
    }
  }

  const [rootItemJson, setRootItemJson] = React.useState(getItemsJson())

  return (
    &amp;lt;div className="widget-demo jimu-widget m-2"&amp;gt;
      &amp;lt;p&amp;gt;Simple Widget&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;exampleConfigProperty: {props.config.exampleConfigProperty}&amp;lt;/p&amp;gt;
      &amp;lt;Tree
        size={'default'}
        collapseStyle={TreeCollapseStyle.PlusMinus}
        dndEnabled={false}
        treeAlignmentType={TreeAlignmentType.Typical}
        treeStyle={TreeStyle.Card}
        isMultiSelection={true}
        checkboxLinkage={true}
        rootItemJson={rootItemJson}
        onUpdateItem={(actionData, refComponent) =&amp;gt; {
          if (actionData.changeItemJson) {
            const [nextRootItemJson] = actionData.itemJsons.slice(-1)
            setRootItemJson({ ...nextRootItemJson })
          }
        }}
      /&amp;gt;
    &amp;lt;/div&amp;gt;
  )
}

export default Widget&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 09:11:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/tree-control-collapse-expand/m-p/1395136#M11554</guid>
      <dc:creator>TianWen</dc:creator>
      <dc:date>2024-03-13T09:11:41Z</dc:date>
    </item>
  </channel>
</rss>

