Advanced search: WIP POC, UI/UX.

SVN:b1162[5493]
This commit is contained in:
Guillaume Lajarige
2018-03-22 16:52:35 +00:00
parent 73e1e3422d
commit 32809ae7d4
5 changed files with 31 additions and 4 deletions

View File

@@ -18,7 +18,15 @@ $(function()
'code': 'in',
'rank': 10,
},
'=': null, // Remove this one from enum widget.
'=': null, // Remove this one from enum widget.
'empty': null, // Remove as it will be handle by the "null" value in the "IN" operator
'not_empty': null, // Remove as it will be handle by the "null" value in the "IN" operator
},
// Null value
'null_value': {
'code': null,
'label': Dict.S('Enum:Undefined'),
},
},
@@ -93,6 +101,18 @@ $(function()
// - Allowed values
var oAllowedValuesElem = $('<div class="sfc_opc_mc_items"></div>');
// - Null value is allowed
// TODO: We might want to move this into the allowed_values for a standard behavior. But that needs to know how to send the "null" value to the server.
if(this.options.field.is_null_allowed === true)
{
var sItemId = 'value_' + sOpId + '_null';
var sValCode = this.options.null_value.code;
var sValLabel = this.options.null_value.label;
var oValueElem = $('<div class="sfc_opc_mc_item" data-value-code="' + sValCode + '"></div>')
.append('<label for="' + sItemId + '"><input type="checkbox" id="' + sItemId + '" value="' + sValCode + '"/>' + sValLabel + '</label>')
.appendTo(oAllowedValuesElem);
}
// - Regular allowed values
if(this.options.field.allowed_values.values !== undefined)
{
var aSortedValues = this._sortValuesByLabel(this.options.field.allowed_values.values);