attribute table - grid - double click

1403
5
08-10-2016 06:02 AM
NatashaManzuiga
Occasional Contributor

Hi all,

in _FeatureTable.js int the createTable function I found the following code.

If I 'm using dblclick on a row associated to an hidden layer..I'm trying to add a message that ask if u want to set Visible the hidden layer and then if the end user choose "OK" set it to visible...but I'm not able to set the layer visibility to true...

this.own(on(

          this.grid,

          ".dgrid-row:dblclick",

          lang.hitch(this, function() {

            if (this.layerInfo &&

              this.layerInfo.isShowInMap()) {

              this._zoomToSelected();

            }

          })));

Thanks,

Naty

0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Emeritus

Naty,

Are getting the this.layerInfo  (i.e it is not undefined) in your code? If so then you need to use this.layerInfo..setTopLayerVisible(true);

NatashaManzuiga
Occasional Contributor

Robert, your code it works...but the layer is not checked in the layer list widget and nothing happens if I check visibility off or on..

Thanks,

Naty

0 Kudos
NatashaManzuiga
Occasional Contributor

Robert, I'm sorry it works for a topLayer......it happens if I click on a row of a table associated to a sublayer (group Layer)...and I dont know how to manage it...

Thanks,

Naty

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Naty,

  It should work for both. The only time I have seen what you are reporting is when I use setTopLayerVisible(true) when the layer is already visible or setTopLayerVisible(false) when the layer is already not visible. For some reason if you try and set the layer to visible when it already is then the LayerList widget gets out of sync and does not work for that layer anymore.

0 Kudos
NatashaManzuiga
Occasional Contributor

Robert, yes, I think it's a bug (For some reason if you try and set the layer to visible when it already is then the LayerList widget gets out of sync and does not work for that layer anymore....).

and then.. if you try to set visible a sublayer...it works and it show the sublayer...but the parent layer it is not selected...

Thanks,

Naty

0 Kudos