How to clear Query Widget Results from a Custom Widget.

613
2
Jump to solution
03-07-2019 10:38 AM
Labels (1)
MuralidharMoka
New Contributor II

Hi,

I have a Custom Widget on left, which has a clear button.

I have a query Widget on the right (red color), which shows some results.

Question:

      How do I clear the results on the query widget by clicking the clear button. Also How do I clear the graphics from the map. this.map.graphics.clear only removes my buffer not the (voilet Symbols).

I tried the following code, but did not work.

clearAll:function(){

var qWidget = WidgetManager.getInstance().getWidgetsByName("Query")[0];
debugger;
if(qWidget){
qWidget._updateResultDetailUI();
}
},
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Here is some code for that:

this.qWidget = WidgetManager.getInstance().getWidgetsByName("Query")[0];
this.qWidget._removeResultLayerInfos(this.qWidget._resultLayerInfos);
setTimeout(lang.hitch(this, function(){
  this.qWidget._showTaskListPane();
}), 500);

View solution in original post

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus

Here is some code for that:

this.qWidget = WidgetManager.getInstance().getWidgetsByName("Query")[0];
this.qWidget._removeResultLayerInfos(this.qWidget._resultLayerInfos);
setTimeout(lang.hitch(this, function(){
  this.qWidget._showTaskListPane();
}), 500);
0 Kudos
MuralidharMoka
New Contributor II

Thank you.

0 Kudos