[#5999] Dropdown field types with OPTGROUP

7 years 9 months ago - 7 years 9 months ago #282104 by musteks
Hi . Tell me please, there was a ready-made solution, dropdown field types with OPTGROUP

Please Log in to join the conversation.

7 years 9 months ago - 7 years 9 months ago #282132 by krileon
Replied by krileon on topic Dropdown field types with OPTGROUP
Our select fields do not support optgroup at this time. I've made a note in the below feature ticket to review implementing this.

forge.joomlapolis.com/issues/4865

For now the only option is a CB Query Field and having a custom database table to store your fields options as CB Query Field can use a database column of a table as its optgroup. CB Code Field can also do this by setting up the appropriate array output.


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.

7 years 9 months ago #282226 by musteks
Replied by musteks on topic Dropdown field types with OPTGROUP
Hi kyle. Please tell me , how to create a database optgroup select, to take him through jqury dropdown field.
For example .
<select name="cb_fleet" id="cb_fleet">
	<option value="">GENERAL FLEET </option> 
	<option value="">TANKERS  LPG </option>
			<optgroup label="OFFSHORE TECHNICAL">
				<option value="">OFFSHORE VESSELS</option>
				<option value="">TUGS</option>
				<option value="">SERVICE AND SPECIALS</option>
			</optgroup>
	<option value="">PASSENGER FLEET</option>
	<option value="">YACHTS</option>
	<option value="">FISdHING</option>
    </select>

And how to make a call to Query Drop Down (Single Select)


Attachments:

Please Log in to join the conversation.

7 years 9 months ago #282242 by krileon
Replied by krileon on topic Dropdown field types with OPTGROUP
You need to make a database table to hold your values. You'll probably want at least 3 columns for value, label, and group. Then under the Options tab you can specify those columns (they need to be in the SELECT of your query). If you've little to no experience with databases please contact a contract developer to implement this for you; I can only provide you with simple examples as follows.


Query:
SELECT `value`, `label`, `group` FROM `#__field_1`
Value Column: value
Label Column: label
Group Column: group


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.

7 years 9 months ago #282368 by musteks
Replied by musteks on topic Dropdown field types with OPTGROUP
Thank you very much!!!
There was one more question on this topic.
Is it possible to set the condition, if optgroup empty


Then he will not be displayed
Attachments:

Please Log in to join the conversation.

7 years 9 months ago #282387 by krileon
Replied by krileon on topic Dropdown field types with OPTGROUP
It not ignoring empty optgroup would be a bug. Fixing for a later release and next nightly release.

forge.joomlapolis.com/issues/5999


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.

Moderators: beatnantkrileon
Time to create page: 0.245 seconds

Facebook Twitter LinkedIn