details: https://code.openbravo.com/erp/devel/pi/rev/11bda20002ae
changeset: 16086:11bda20002ae
user: Augusto Mauch <augusto.mauch <at> openbravo.com>
date: Mon Apr 16 10:54:41 2012 +0200
summary: Fixes issue 20214: Date column filtering improved
Now it is possible to enter '#' and '!#' in the filter of the date columns to
retrieve the records that do not have a value in that column and the records
that do have a value, respectively.
diffstat:
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-minidaterange.js
| 27 ++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diffs (51 lines):
diff -r 886ad864ee06 -r 11bda20002ae
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-minidaterange.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-minidaterange.js
Wed Apr 04 12:10:50 2012 +0200
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-minidaterange.js
Mon Apr 16 10:54:41 2012 +0200
@@ -316,6 +316,16 @@
return;
}
+ if (criterion.operator === 'isNull') {
+ this.setValue('#');
+ return;
+ }
+
+ if (criterion.operator === 'notNull') {
+ this.setValue('!#');
+ return;
+ }
+
if (criterion.operator === 'equals') {
this.setSingleDateValue(criterion.value);
return;
@@ -331,6 +341,19 @@
},
getCriterion: function () {
+ var value = this.blurValue();
+ if (value === '#') {
+ return {
+ fieldName: this.name,
+ operator: 'isNull'
+ };
+ }
+ if (value === '!#') {
+ return {
+ fieldName: this.name,
+ operator: 'notNull'
+ };
+ }
if (this.singleDateValue) {
return {
fieldName: this.name,
@@ -343,6 +366,10 @@
},
canEditCriterion: function (criterion) {
+
+ if (criterion.fieldName === this.name && (criterion.operator === 'isNull'
|| criterion.operator === 'notNull')) {
+ return true;
+ }
if (this.singleDateMode && criterion.fieldName === this.name) {
return true;
}
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits