<?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 SketchViewModel methods turning off layerList toogle in Calcite Design System Questions</title>
    <link>https://community.esri.com/t5/calcite-design-system-questions/sketchviewmodel-methods-turning-off-layerlist/m-p/1178507#M145</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I have an ActionToogle in a layerList item that opens/creates a featureTable and a Sketch widget at the same time - I am using the sketch widget output geometry to filter the featureTable rows.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Whenever I click&amp;nbsp; a button to initiate the graphic´s drawing, the layerList toogle "inadvertently" turns off.&lt;/P&gt;&lt;P&gt;The same happens if, instead of using the sketchWidget and its default buttons, I program a custom UI as in the sample &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=sketch-viewmodel-styler" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=sketch-viewmodel-styler&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;which has sketchViewModel methods associated to calcite-action.&lt;/P&gt;&lt;P&gt;The buttons in the sketch menu that turn off the toogle in the layerList are those with create() or update() methods underneath. It seams that the create and update methods disable other buttons that are active in&amp;nbsp;the sketch menu and in the layerList.&lt;/P&gt;&lt;P&gt;It would be no problem if it turned off buttons in the sketch menu only (e.g. as I click a button to draw a polygon it disables the button to draw a line).&lt;/P&gt;&lt;P&gt;Would there be a way of discriminating layerList and sketchWidget events so that sketchViewModel events dont affect the layer list toogle? Or would there be a way of modifying the create() or update() methods so that they dont disable other buttons by default?&lt;/P&gt;&lt;P&gt;Thank you very much in advance&lt;/P&gt;</description>
    <pubDate>Tue, 31 May 2022 11:39:35 GMT</pubDate>
    <dc:creator>AdrianaPaese</dc:creator>
    <dc:date>2022-05-31T11:39:35Z</dc:date>
    <item>
      <title>SketchViewModel methods turning off layerList toogle</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/sketchviewmodel-methods-turning-off-layerlist/m-p/1178507#M145</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I have an ActionToogle in a layerList item that opens/creates a featureTable and a Sketch widget at the same time - I am using the sketch widget output geometry to filter the featureTable rows.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Whenever I click&amp;nbsp; a button to initiate the graphic´s drawing, the layerList toogle "inadvertently" turns off.&lt;/P&gt;&lt;P&gt;The same happens if, instead of using the sketchWidget and its default buttons, I program a custom UI as in the sample &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=sketch-viewmodel-styler" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=sketch-viewmodel-styler&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;which has sketchViewModel methods associated to calcite-action.&lt;/P&gt;&lt;P&gt;The buttons in the sketch menu that turn off the toogle in the layerList are those with create() or update() methods underneath. It seams that the create and update methods disable other buttons that are active in&amp;nbsp;the sketch menu and in the layerList.&lt;/P&gt;&lt;P&gt;It would be no problem if it turned off buttons in the sketch menu only (e.g. as I click a button to draw a polygon it disables the button to draw a line).&lt;/P&gt;&lt;P&gt;Would there be a way of discriminating layerList and sketchWidget events so that sketchViewModel events dont affect the layer list toogle? Or would there be a way of modifying the create() or update() methods so that they dont disable other buttons by default?&lt;/P&gt;&lt;P&gt;Thank you very much in advance&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 11:39:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/sketchviewmodel-methods-turning-off-layerlist/m-p/1178507#M145</guid>
      <dc:creator>AdrianaPaese</dc:creator>
      <dc:date>2022-05-31T11:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: SketchViewModel methods turning off layerList toogle</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/sketchviewmodel-methods-turning-off-layerlist/m-p/1178799#M146</link>
      <description>&lt;P&gt;It is hard to tell what is going wrong without seeing any code, but my guess is you are listening to events like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;document.addEventListener(...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If there are multiple elements that emit the same event type but their event listeners need different callback functions, then you should add the listeners directly to the specific elements. e.g.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;document.getElementById("featureTableButton").addEventListener(...

document.getElementById("sketchButton").addEventListener(...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If that doesn't help, can you please provide a codepen that reproduces the issue?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 16:35:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/sketchviewmodel-methods-turning-off-layerlist/m-p/1178799#M146</guid>
      <dc:creator>BenElan</dc:creator>
      <dc:date>2022-06-01T16:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: SketchViewModel methods turning off layerList toogle</title>
      <link>https://community.esri.com/t5/calcite-design-system-questions/sketchviewmodel-methods-turning-off-layerlist/m-p/1178811#M147</link>
      <description>&lt;P&gt;Thank you very much&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/71373"&gt;@BenElan&lt;/a&gt;&lt;/P&gt;&lt;P&gt;I will try and get back to you soon&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 21:40:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/calcite-design-system-questions/sketchviewmodel-methods-turning-off-layerlist/m-p/1178811#M147</guid>
      <dc:creator>AdrianaPaese</dc:creator>
      <dc:date>2022-05-31T21:40:38Z</dc:date>
    </item>
  </channel>
</rss>

