Select to view content in your preferred language

esearch default filter

7202
35
03-22-2016 09:59 AM
RudoDuncan
Deactivated User


Is it possible to display the first couple of days of calls for service so that my users can see the last 48hrs by default? Then if they wanted to see something prior to that they can search for it using the filter. Currently, my users have to put in a date filter every time they open the application.

0 Kudos
35 Replies
RobertScheitlin__GISP
MVP Emeritus

Rudo,

  I need to see your config_Calls for Service Search.json as well. Obviously I don't have access to

http://phqgis01:6080/arcgis/rest/services/CallsForServiceWeb/MapServer/0 so I changed the url and fields to use one of esri sample services and I was able to get this working in your widget.

0 Kudos
RudoDuncan
Deactivated User

Really what did you change?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Like I said, I had to change to a different layer and expression, fields, etc, and of course remove the code from the _removeResultItem function. I think it has something to do with the configuration of your search layer. Is the only thing that layer one expression one have is a date range? This is why I need to see your json.

0 Kudos
RudoDuncan
Deactivated User

I have attached the config_Calls for Service Search.json and the widget is using one layer, that has 12 different filter options. The date range is the very last one?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rudo,

  So that is the issue the code is only setup to provide data for one entry (one expression value). I only knew about your need to search for the last 48 hours not 11 other criteria in addition to the last 48 hours.

0 Kudos
RudoDuncan
Deactivated User

That's my mistake, I guess I thought that I could make it ignore the other criteria when the widget is clicked on and automatically open up the last 48 hours as a default. After the defaults are opened, I thought I would be able to go through my regular filter options and select what filters I want to display, if I wanted to see something more specific. My apologies Robert.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rudo,

  So you could setup a second expression that only uses the date range then, and the use:

this._queryFromURL(startTime + "~" + endTime, 0, 1, false);

Or you could move the date range expression to the very first expression value instead of the last one.

0 Kudos
RudoDuncan
Deactivated User

Could I use this?

this._queryFromURL(startTime + "~" + endTime, 0, 11, false);

Will that make it look at the 12 fields (i.e. date range field)?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rudo,

  No you are confusing expression values with expressions. When you configure a search layer you can have multiple expressions (or one as you have) and each expression can have multiple expression values (like you 12 expression values). The _queryFromURL function takes the parameters of search value, search layer #, expression #, close widget.

0 Kudos
RudoDuncan
Deactivated User

So I have to put my date range at the top of my filter list for it to work?

0 Kudos