Autocomplete function on CB query field

4 years 9 months ago #312895 by wegda
Ive got a query for my column cb_rdapartnernr(lik user_id) thats it unique. My sql query works fine an tells the editor when the rdapartnernr is in used.
But now is it possible to show or insert automaticly a free number names rdapartnernr ? Can u give me an explain?

Please Log in to join the conversation.

4 years 9 months ago #312896 by krileon
Replied by krileon on topic Autocomplete function on CB query field
The autocomplete feature only applies to text fields. When the user begins typing it can suggest values for them to select which will insert into the text field. It will not limit them to only using those selections. So with that said simply edit your text field then under Integrations > CB Query Field > Auto Complete you can configure it as follows.

Query Auto Complete: Enable
Query:
SELECT `id`, `username` FROM `#__users` WHERE `username` LIKE '[value]%' LIMIT 10
Value Column: id
Label Column: username
Minimum Length: 3

With the above example it would autocomplete a users username and store the users user id. The "Value Column" parameter determines what is inserted into the text field while "Label Column" is just for display purposes. So if you need it to insert some sort of new number based off the current numbers you'll need to generate that and return it in your SQL.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

4 years 9 months ago #312903 by wegda
Replied by wegda on topic Autocomplete function on CB query field
Aha ok. So it is possible to suggest a free number inside the column thats is not in use?

Please Log in to join the conversation.

4 years 9 months ago #312907 by krileon
Replied by krileon on topic Autocomplete function on CB query field
Yes, I assume you've a database table with those free numbers listed somewhere? If so you'd just make sure your query is querying that table and joining _comprofiler to check that it doesn't exist before suggesting it.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

4 years 9 months ago #313260 by nant
Replied by nant on topic Autocomplete function on CB query field

wegda wrote: Aha ok. So it is possible to suggest a free number inside the column thats is not in use?


This video should help

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.174 seconds

Facebook Twitter LinkedIn