Tagged: add_more, conditions, groups
- This topic has 5 replies, 2 voices, and was last updated 7 years, 1 month ago by
Steve.
-
AuthorPosts
-
-
November 3, 2014 at 8:20 am #2631
mrioaMemberNote sure if my problem is related to the ones described here. Are the ones mentioned in this thread already supposed to be fixed?
I’m having a radio-field outside of a group. Based on that value I have conditional add_more groups with simple text-fields inside. But when I add a new group, it is hidden even though the radio choice is set to the needed value. When I switch the radio to another value and back to my desired one, the new group is shown properly. (see the gif)
/* * Choice of item type * default value = drink */ piklist('field', array( 'type' => 'radio' , 'field' => 'type' , 'label' => 'Typ' , 'choices' => array( 'drink' => 'drink' , 'other' => 'other' ) , 'value' => 'drink' )); /* * Group buy drinks * add more * condition if type = drink * 2 text fields "buy_size" and "buy_price" */ piklist('field', array( 'type' => 'group' , 'field' => 'buy' , 'label' => 'Einkauf' , 'add_more' => true , 'conditions' => array( array( 'field' => 'type' , 'value' => 'drink' ) ) , 'fields' => array( array( 'type' => 'text' , 'field' => 'buy_size' , 'label' => 'size') , array( 'type' => 'text' , 'field' => 'buy_price' , 'label' => 'price' ) ) ));If there is a way to set the initial visibility of an added conditional group based on it’s precedessor, that would be great 🙂
Attachments:
You must be logged in to view attached files. -
November 3, 2014 at 1:24 pm #2633
SteveKeymaster@mrioa– I split this into another topic since it had nothing in common with the other ticket.
Piklist comes with a grid system for fields. You need to use it when creating GROUP fields. Try adding the columns parameter:
piklist('field', array( 'type' => 'group' , 'field' => 'buy' , 'label' => 'Einkauf' , 'add_more' => true , 'fields' => array( array( 'type' => 'text' , 'field' => 'buy_size' , 'label' => 'size' , 'columns' => 12 ) , array( 'type' => 'text' , 'field' => 'buy_price' , 'label' => 'price' , 'columns' => 12 ) ) )); -
December 19, 2014 at 12:03 pm #3121
mrioaMember@Steve- I’m so sorry, I didn’t realize the topic splitting and thought my post in the other topic got lost (I wasn’t using my own device to post it that day).
Glad I found your info today, it’s working now!
Thanks to adding the column-setting I was able to update to the latest version of piklist without a problem.
But now I’m missing the description of fields inside a group. I assume this is due to the point “ENHANCED: Updates to group fields” in 0.9.4.23.
Did it just got removed or is there a new way of using it?Thank you so much for the great tool and excellent support!
Cheers,
Mario -
December 19, 2014 at 4:11 pm #3124
-
December 21, 2014 at 4:48 am #3125
mrioaMemberRight, I added it afterwards:
Example:
piklist('field', array( 'type' => 'group' , 'label' => 'Einkauf' , 'add_more' => true , 'fields' => array( array( 'type' => 'text' , 'field' => 'buy_size' , 'label' => 'size' , 'description => 'Additional info' , 'columns' => 12 ) , array( 'type' => 'text' , 'field' => 'buy_price' , 'label' => 'price' , 'description => 'Additional info' , 'columns' => 12 ) ) )); -
December 21, 2014 at 11:09 pm #3126
-
-
AuthorPosts
- The topic ‘Group field add-mores’ is closed to new replies.