Currently when I open the select widget in web appbuilder the features currently set for selection match the layers I have check on in my layer list. I would like to modify the select widget code so that all the layers are unchecked by default and not tied to items checked on/off in the layer list.
Joel,
If you are using WAB Dev edition then you can edit the select Widget.js in the _initLayers function (line 13):
_initLayers: function(layerInfoArray) { this.layerInfoArray = layerInfoArray; this.layerItems = []; this.selectionSymbols = {}; html.empty(this.layerItemsNode); array.forEach(layerInfoArray, lang.hitch(this, function(layerInfo) { var visible = layerInfo.isShowInMap() && layerInfo.isInScale(); var item = new SelectableLayerItem({ layerInfo: layerInfo, checked: false, layerVisible: visible, folderUrl: this.folderUrl, allowExport: this.config ? this.config.allowExport : false, map: this.map, nls: this.nls });
Just curious, does anyone know what area of code needs to be modified to select features that are not zoom scale dependent? The way this widget is currently setup is to only select features that are in view, but once you zoom out, you can't select anything. The layer grey's out (I've solved that issue) but you still cant select anything.
Thanks!
Ok downloading WAB again did not fix it, but after closely looking at map services where the selection does work and where it does I noticed that if I publish a feature class with object id and shape turned off in field properties that affected it. I turned on both and republished, no idea that was affecting it but now it all works.
George I would definitely give that a try.
I am having a lot of quirkiness issues with Wab 2.5 lately, select widget selects but does not highlight the selection, query widget added for a second time the query is performed but the query will not draw? All this happened after I upgraded to windows 10, something has become corrupted or something in windows 10 I have no idea. Should I uninstall/delete v 2.5 and try to install again?
Anybody know why when I use the select widget in the fold-able theme wab 2.5 the selection does not show now?
I have not seen that one.
I have a WAB map. when the mapservice is not symbolized by a value the select widget shows the selection
when a map service is symbolized by a value the selection does not show. Is this a bug? The popup shows that I have a selection.
Hi Robert,
I just tried this line of code to see how it's like and already it gives me error : "Expected identifier or string".
Could you please tell me what is wrong with my codes ?
Much appreciated!
_initLayers: function(layerInfoArray) { this.layerInfoArray = layerInfoArray; this.layerItems = []; this.selectionSymbols = {};
html.empty(this.layerItemsNode);
array.forEach(layerInfoArray, lang.hitch(this, function(layerInfo) { var visible = layerInfo.isShowInMap() && layerInfo.isInScale();
var item = new SelectableLayerItem({ layerInfo: layerInfo,
if (item.layerName ==='Accounts'){ checked: visible; } else { checked: false; }
layerVisible: visible, folderUrl: this.folderUrl, allowExport: this.config ? this.config.allowExport : false, map: this.map, nls: this.nls });
Helen,
Check the layerInfo to see if it is the layer that you need and if so don't change the SelectableLayerItem checked to false.
Robert,
I need 1 layer checked by default. How do I do it ?
Thanks
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.