Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for gxp #189 - allow matchCase in WFS Filter #190

Merged
merged 2 commits into from
May 26, 2013
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
8 changes: 7 additions & 1 deletion 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 @@ -165,7 +171,7 @@ gxp.form.FilterField = Ext.extend(Ext.form.CompositeField, {
* {OpenLayers.Filter} By default, returns a comarison filter.
*/
createDefaultFilter: function() {
return new OpenLayers.Filter.Comparison();
return new OpenLayers.Filter.Comparison({matchCase: this.caseInsensitiveMatch});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be {matchCase: !this.caseInsensitiveMatch}) instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, yes indeed. Added a new commit to fix. best, Just
On 26-05-13 01:57, ahocevar wrote:

In src/script/widgets/form/FilterField.js:

@@ -165,7 +171,7 @@ gxp.form.FilterField = Ext.extend(Ext.form.CompositeField, {
* {OpenLayers.Filter} By default, returns a comarison filter.
*/
createDefaultFilter: function() {

  •    return new OpenLayers.Filter.Comparison();
    
  •    return new OpenLayers.Filter.Comparison({matchCase: this.caseInsensitiveMatch});
    

Shouldn't this be |{matchCase: !this.caseInsensitiveMatch})| instead?


Reply to this email directly or view it on GitHub
https://github.com/opengeo/gxp/pull/190/files#r4393548.

},

/**
Expand Down