var $type = $('#' + real_id + '_type');
var $unit = $('#' + real_id + '_unit');
var $convertible_unit = $('#' + real_id + '_convertible_unit');
- var $column = $('#' + real_id + '_column');
var state = STATES.PICKED;
var last_real = $real.val();
var last_dummy = $dummy.val();
'filter.obsolete': 0,
'filter.unit_obj.convertible_to': $convertible_unit && $convertible_unit.val() ? $convertible_unit.val() : '',
no_paginate: $('#no_paginate').prop('checked') ? 1 : 0,
- column: $column && $column.val() ? $column.val() : '',
current: $real.val(),
};
function set_item (item) {
if (item.id) {
$real.val(item.id);
- // autocomplete ui has name, ajax items have description
- $dummy.val(item.name ? item.name : item.description);
+ // autocomplete ui has name, use the value for ajax items, which contains displayable_name
+ $dummy.val(item.name ? item.name : item.value);
} else {
$real.val('');
$dummy.val('');
var picker = $('<div>');
$dummy.after(pcont);
pcont.append(picker);
- picker.addClass('icon16 crm--search').click(open_dialog);
+ picker.addClass('icon16 search').click(open_dialog);
var pp = {
real: function() { return $real },
type: function() { return $type },
unit: function() { return $unit },
convertible_unit: function() { return $convertible_unit },
- column: function() { return $column },
update_results: update_results,
result_timer: result_timer,
set_item: set_item,