This is cross post from "Documents" section (sorry about that getting used to new forum).
From the Widget.js of the eSearch, what is the best way to get the value from the currently selected value in the search layer drop down list?
Thanks!
Solved! Go to Solution.
James,
If I am understanding your question correctly you are asking to know which search Layer is selected.
To get the index:
this.AttributeLayerIndex
If you want the actual layer object then:
this.config.layers[this.AttributeLayerIndex]
If you just want the text/name then:
this.selectLayerAttribute.get('value')
James,
If I am understanding your question correctly you are asking to know which search Layer is selected.
To get the index:
this.AttributeLayerIndex
If you want the actual layer object then:
this.config.layers[this.AttributeLayerIndex]
If you just want the text/name then:
this.selectLayerAttribute.get('value')
I think that will do it. I was expecting the text value of the selected search layer but get it's index. Not a big deal, I can work with this! Thank you Robert!
(I need to get better at inspecting elements and locating them, not sure why I struggle with this!)
James,
The third option I provided should give you the text.
That's the one I used but gives the index. Perfectly fine with me, it's actually preferable in case search layer names get changed but I just have to be careful not to shuffle things around without updating some conditional logic I have added.
All good -- thanks again Robert!