- return {
- term: term,
- type: function() { return $type.val() },
- column: function() { return $column.val()===undefined ? '' : $column.val() },
- current: function() { return $real.val() },
- obsolete: 0,
- }
+ var data = {
+ 'filter.all:substr:multi::ilike': term,
+ 'filter.obsolete': 0,
+ 'filter.unit_obj.convertible_to': $convertible_unit && $convertible_unit.val() ? $convertible_unit.val() : '',
+ no_paginate: $('#no_paginate').prop('checked') ? 1 : 0,
+ current: $real.val(),
+ };
+
+ if ($type && $type.val())
+ data['filter.type'] = $type.val().split(',');
+
+ if ($unit && $unit.val())
+ data['filter.unit'] = $unit.val().split(',');
+
+ return data;