bool field filter: checked by default

This commit is contained in:
yuri
2016-02-19 11:51:27 +02:00
parent bc7583ccb4
commit c6816b01b5
3 changed files with 14 additions and 2 deletions
+4
View File
@@ -55,6 +55,10 @@ Espo.define('views/fields/bool', 'views/fields/base', function (Dep) {
};
return data;
},
populateSearchDefaults: function () {
this.$element.get(0).checked = true;
}
});
});
+3 -2
View File
@@ -161,7 +161,8 @@ Espo.define('views/record/search', 'view', function (Dep) {
this.presetName = this.primary;
this.createFilter(name, {}, function () {
this.createFilter(name, {}, function (view) {
view.populateDefaults();
this.fetch();
this.updateSearch();
}.bind(this));
@@ -599,7 +600,7 @@ Espo.define('views/record/search', 'view', function (Dep) {
}, function (view) {
if (typeof callback === 'function') {
view.once('after:render', function () {
callback();
callback(view);
});
}
if (rendered && !noRender) {
+7
View File
@@ -58,6 +58,13 @@ Espo.define('views/search/filter', 'view', function (Dep) {
});
}
},
populateDefaults: function () {
var view = this.getView('field');
if (!view) return;
if (!('populateSearchDefaults' in view)) return;
view.populateSearchDefaults();
}
});
});