Khushboo Bhatt(openerp) has proposed merging
lp:~openerp-dev/openerp-web/trunk_searchview_clear_kbh into lp:openerp-web.
Requested reviews:
OpenERP R&D Web Team (openerp-dev-web)
For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk_searchview_clear_kbh/+merge/69995
implement search view for clear.
--
https://code.launchpad.net/~openerp-dev/openerp-web/trunk_searchview_clear_kbh/+merge/69995
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openerp-web/trunk_searchview_clear_kbh.
=== modified file 'addons/base/static/src/js/search.js'
--- addons/base/static/src/js/search.js 2011-07-28 16:59:14 +0000
+++ addons/base/static/src/js/search.js 2011-08-01 12:34:33 +0000
@@ -315,10 +315,28 @@
on_invalid: function (errors) {
this.notification.notify("Invalid Search", "triggered from search view");
},
- do_clear: function (e) {
- if (e && e.preventDefault) { e.preventDefault(); }
- this.on_clear();
- },
+ do_clear: function (e) {
+
+ this.$element.find('input').val('');
+
+ var errors = [];
+ try {
+ }catch (e) {
+ if (e instanceof openerp.base.search.Invalid) {
+ errors.push(e);
+ } else {
+ throw e;
+ }
+ }
+ if (e && e.preventDefault) { e.preventDefault(); }
+
+ this.dataset.domain = [];
+ $('.filter_label').removeClass('enabled');
+ this.enabled_filters = [];
+ this.$element.find('form').submit();
+ this.on_clear();
+
+ },
/**
* Triggered when the search view gets cleared
*
@@ -573,6 +591,7 @@
filter_node, view);
}), view);
this.make_id('input', field.type, this.attrs.name);
+ var i = this.make_id('input', field.type, this.attrs.name);
},
start: function () {
this._super();
@@ -622,7 +641,7 @@
default_operator: 'ilike',
get_value: function () {
return this.$element.val();
- }
+ },
});
openerp.base.search.BooleanField = openerp.base.search.Field.extend({
template: 'SearchView.field.selection',
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp