diff --git a/src/script/widgets/FilterBuilder.js b/src/script/widgets/FilterBuilder.js index 1b48a2dc..c643186b 100644 --- a/src/script/widgets/FilterBuilder.js +++ b/src/script/widgets/FilterBuilder.js @@ -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"``. @@ -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] @@ -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); diff --git a/src/script/widgets/QueryPanel.js b/src/script/widgets/QueryPanel.js index f1714b33..4ff7eb07 100644 --- a/src/script/widgets/QueryPanel.js +++ b/src/script/widgets/QueryPanel.js @@ -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. @@ -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) { diff --git a/src/script/widgets/form/FilterField.js b/src/script/widgets/form/FilterField.js index 37b78657..f4c8bd1b 100644 --- a/src/script/widgets/form/FilterField.js +++ b/src/script/widgets/form/FilterField.js @@ -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 @@ -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}); }, /**