Advanced search: Fix criteria closed after search modal.

SVN:trunk[5695]
This commit is contained in:
Guillaume Lajarige
2018-04-19 07:37:11 +00:00
parent 381a988f43
commit e9440d0d4c
2 changed files with 12 additions and 9 deletions

View File

@@ -101,14 +101,6 @@ $(function()
this._super( key, value );
},
_initChooseDefaultOperator: function() {
//if the class has an index, in order to maximize the performance, we force the default operator to "equal"
if (this.options.field.has_index && typeof this.options.available_operators['='] == 'object')
{
this.options.operator = '=';
this.options.available_operators['='].rank = -1;//we want it to be the first displayed
}
},
// Protected methods
// - Init operators by cleaning up available operators and ordering them.
// Note: A null operator or an operator with a rank "false" will be removed.
@@ -157,6 +149,15 @@ $(function()
this.options.operator = Object.keys(this.operators)[0];
}
},
_initChooseDefaultOperator: function()
{
//if the class has an index, in order to maximize the performance, we force the default operator to "equal"
if (this.options.field.has_index && typeof this.options.available_operators['='] == 'object')
{
this.options.operator = '=';
this.options.available_operators['='].rank = -1;//we want it to be the first displayed
}
},
// - Bind external events
_bindEvents: function()
{

View File

@@ -91,7 +91,9 @@ $(function()
_onAddSelectedValues: function(oData)
{
this._addSelectedValues(oData);
//this._apply();
// Note: Selecting values elsewhere (eg. a popup) closes the criteria on the first click, so when the user goes back to the form, the criteria has the new values displayed but not selected. So as a workaround we apply and re-open the criteria.
this._apply();
this._open();
},
// DOM element helpers