Select to view content in your preferred language

Sketch widget disables layerList toogle

504
0
05-31-2022 04:46 AM
AdrianaPaese
Frequent Contributor

Hello

I appologize for posting again, I hope it is better explained below

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. 

Whenever I click  a button to initiate the graphic´s drawing, the layerList toogle "inadvertently" turns off.

The same happens if, instead of using the sketchWidget and its default buttons, I program a custom UI as in the sample https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=sketch-viewmodel-styler 

which has sketchViewModel methods associated to calcite-action.

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 the sketch menu and in the layerList.

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).

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?

Thank you very much in advance

0 Replies