Setup autocomplete for a reference field

OOB autocompleter for reference field searches only a diplay field and also showing its value in the dropdown. To change this behaviour we need to add following attributes to the field dictionary.

ref_ac_columns_search=true, ref_auto_completer=AJAXTableCompleter, ref_ac_columns=asset_tag;model, ref_ac_display_value=false

How does it work:

  • ref_ac_columns_search activates searching on selected columns
  • ref_ac_columns sets the columns to be searched through (also these columns will be shown in the popup)
  • ref_auto_completer just use it as it is
  • ref_ac_display_value hide display value of records from dropdown. normally you would wish to hide it, as it not being used in search.
comments powered by Disqus

Related