AnsweredAssumed Answered

Obtain date range value from Filter widget

Question asked by louchios on Jun 8, 2017
I would like the user to be forced to conduct a filter using the filter widget before making the layer visible. I have the filter widget set up to filter by date range. I would like the date range to be 30 days or less before the user can turn on the layer. I'm not sure if this would be a simple html end date text box value minus the start date text box value, or would require code for intercommunication between widgets?
Here is the code I added to the LayerList widget js file (line 232) which alerts the user when making the specific layer visible. However, it has no functionality yet in regards to the date range since it hasn't been calculated yet.
            var visibleCheckBox = registry.byNode(visibleCheckBoxDomNode);
            if(layerInfo.isVisible()) {
if(layerInfo.id === "Portal_7808"){
alert("Please use the filter widget in the top left corner to filter a date range of 30 days or less. This layer contains many polygons and a filter is required otherwise it will overload the application.")
}

Outcomes