Skip to content

Commit

Permalink
Merge pull request #87 from Esri/Filter-string-bug
Browse files Browse the repository at this point in the history
add default query.where
  • Loading branch information
rslibed authored Jul 18, 2022
2 parents ee382b7 + f031643 commit f025e68
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 2,307 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 1.6.4

- FilterList
1. query.where bug fix

## 1.6.3

- Screenshot
Expand Down
4 changes: 2 additions & 2 deletions FilterList/FilterList/FilterListViewModel.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion FilterList/FilterList/FilterListViewModel.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions FilterList/FilterList/FilterListViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ class FilterListViewModel extends Accessor {
query.cacheHint = true;
}
if (field) {
query.where = this._initDefExpressions?.[layerId];
query.where = this._initDefExpressions?.[layerId] || "1=1";
query.outFields = [field];
query.orderByFields = [`${field} DESC`];
query.returnDistinctValues = true;
Expand All @@ -339,7 +339,7 @@ class FilterListViewModel extends Accessor {
const layer = this.map.allLayers.find(({ id }) => id === layerId) as __esri.FeatureLayer;
if (layer && layer.type === "feature") {
const query = layer.createQuery();
query.where = this._initDefExpressions?.[layerId];
query.where = this._initDefExpressions?.[layerId] || "1=1";
if (layer?.capabilities?.query?.supportsCacheHint) {
query.cacheHint = true;
}
Expand Down
Loading

0 comments on commit f025e68

Please sign in to comment.