Skip to content

Commit

Permalink
Merge pull request #190 from justb4/master
Browse files Browse the repository at this point in the history
Fix for gxp #189 - allow matchCase in WFS Filter
  • Loading branch information
ahocevar committed May 26, 2013
2 parents 1f92033 + 0d1e37c commit 5a1f79a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
10 changes: 9 additions & 1 deletion src/script/widgets/FilterBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ gxp.FilterBuilder = Ext.extend(Ext.Container, {
*/
allowBlank: false,

/** api: config[caseInsensitiveMatch]
* ``Boolean``
* Should Comparison Filters for Strings do case insensitive matching? Default is ``"false"``.
*/
caseInsensitiveMatch: false,

/** api: config[preComboText]
* ``String``
* String to display before filter type combo. Default is ``"Match"``.
Expand Down Expand Up @@ -327,7 +333,8 @@ gxp.FilterBuilder = Ext.extend(Ext.Container, {
},

createDefaultFilter: function() {
return new OpenLayers.Filter.Comparison();
return new OpenLayers.Filter.Comparison({
matchCase: !this.caseInsensitiveMatch});
},

/** private: method[wrapFilter]
Expand Down Expand Up @@ -375,6 +382,7 @@ gxp.FilterBuilder = Ext.extend(Ext.Container, {
attributes: this.attributes,
allowBlank: group ? undefined : this.allowBlank,
customizeFilterOnInit: group && false,
caseInsensitiveMatch: this.caseInsensitiveMatch,
listeners: {
change: function() {
this.fireEvent("change", this);
Expand Down
11 changes: 9 additions & 2 deletions src/script/widgets/QueryPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@ gxp.QueryPanel = Ext.extend(Ext.Panel, {
* Query by attributes.
*/
attributeQuery: true,


/** api: config[caseInsensitiveMatch]
* ``Boolean``
* Should Comparison Filters for Strings do case insensitive matching? Default is ``"false"``.
*/
caseInsensitiveMatch: false,

/** private: property[selectedLayer]
* ``Ext.data.Record``
* The currently selected record in the layers combo.
Expand Down Expand Up @@ -292,7 +298,8 @@ gxp.QueryPanel = Ext.extend(Ext.Panel, {
this.filterBuilder = new gxp.FilterBuilder({
//anchor: "-8px",
attributes: this.attributeStore,
allowGroups: false
allowGroups: false,
caseInsensitiveMatch: this.caseInsensitiveMatch
});

if(owner) {
Expand Down
10 changes: 8 additions & 2 deletions src/script/widgets/form/FilterField.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ gxp.form.FilterField = Ext.extend(Ext.form.CompositeField, {
*/
upperBoundaryTip: "upper boundary",

/** api: config[caseInsensitiveMatch]
* ``Boolean``
* Should Comparison Filters for Strings do case insensitive matching? Default is ``"false"``.
*/
caseInsensitiveMatch: false,

/**
* Property: filter
* {OpenLayers.Filter} Optional non-logical filter provided in the initial
Expand Down Expand Up @@ -162,10 +168,10 @@ gxp.form.FilterField = Ext.extend(Ext.form.CompositeField, {
* May be overridden to change the default filter.
*
* Returns:
* {OpenLayers.Filter} By default, returns a comarison filter.
* {OpenLayers.Filter} By default, returns a comparison filter.
*/
createDefaultFilter: function() {
return new OpenLayers.Filter.Comparison();
return new OpenLayers.Filter.Comparison({matchCase: !this.caseInsensitiveMatch});
},

/**
Expand Down

0 comments on commit 5a1f79a

Please sign in to comment.