redux-framework icon indicating copy to clipboard operation
redux-framework copied to clipboard

select2 after section reset

Open oztecnic opened this issue 12 years ago • 8 comments

When i reset a section tab, select 2 fails like this.

bugguy-2

oztecnic avatar Feb 27 '14 10:02 oztecnic

ıt is trying to load the array set related to select2, there must be no value after reset.

oztecnic avatar Feb 27 '14 10:02 oztecnic

Well how about you provide your field config so we can try to duplicate or help you debug? ;)

dovy avatar Feb 27 '14 14:02 dovy

Hello,

array( 'id'=>'val_header_social_icons', 'type' => 'select', 'title' => __('Select Social Icons @Header', THEME_NAME), 'subtitle' => __('Please select social icons that you want to see @header.', THEME_NAME), 'required' => array('is_show_social_icons_at_header', '=' , '1'), 'multi' => true, 'sortable' => true, 'options' => array( 'facebook' => 'Facebook', 'twitter' => 'Twitter', 'google-plus' => 'Google Plus', 'pinterest' => 'Pinterest', 'youtube' => 'Youtube', 'vimeo-square' => 'Vimeo', 'tumblr' => 'Tumblr', 'linkedin' => 'Linkedin', 'instagram' => 'Instagram', 'github' => 'GitHub', 'rss' => 'RSS' ), 'select2' => array('minimumResultsForSearch' => -1) ),

oztecnic avatar Feb 27 '14 18:02 oztecnic

Sorry, but the code you provided does not work when I paste it into my config file. We'll probably need to see the entire section.

kprovance avatar Mar 02 '14 01:03 kprovance

Hi, Here;

$sections[] = array(
    'icon' => 'el-icon-chevron-right',
    'icon_class' => '',
    'title' => __('Header Options', THEME_NAME),
    'desc' => __('<p style="font-size:16px;">You can manage header elements here.', THEME_NAME),
    'fields' => array(


        array(
            'id'=>'h_raw_info_1',
            'type' => 'info',
            'class' => 'info-area',
            'raw_html'=>true,
            'desc' => sprintf($sub_section,'Header Behaviour', 'You can change header visibility and make it fixed.'),
            ),


        array(
            'id'=>'is_header_on',
            'type' => 'switch', 
            'title' => __('Show Header', THEME_NAME),
            'subtitle'=> __('Toggle it to show/hide header  @page load. If you hide it, when you scroll sticky header will be shown.', THEME_NAME),
            'default' => 1
            ),

        array(
            'id'=>'is_sticky_nav_on',
            'type' => 'switch', 
            'title' => __('Sticky Header', THEME_NAME),
            'subtitle'=> __('Toggle it to enable/disable sticky header. If you disable this, header will not follow, when you scroll.', THEME_NAME),
            'default' => 1
            ),


        array(
            'id'=>'h_raw_info_2',
            'type' => 'info',
            'class' => 'info-area',
            'raw_html'=>true,
            'desc' => sprintf($sub_section,'Header Elements', 'You can add or remove header elements.'),
            ),


        array(
            'id'=>'is_header_top_on',
            'type' => 'switch', 
            'title' => __('Header Top Area', THEME_NAME),
            'subtitle'=> __('Toggle it to show/hide header top area.', THEME_NAME),
            'default' => 0
            ),


            array(
                'id'=>'is_show_social_icons_at_header',
                'type' => 'switch', 
                'title' => __('Social Icons @Header', THEME_NAME),
                'required' => array('is_header_top_on', '=' , '1'),
                'subtitle'=> __('Toggle it to show/hide social icons.', THEME_NAME),
                'default' => 1
            ),

                    array(
                        'id'=>'val_show_social_icons_position',
                        'type' => 'button_set', 
                        'title' => __('Social Icons Position', THEME_NAME),
                        'required' => array('is_show_social_icons_at_header', '=' , '1'),
                        'subtitle'=> __('Select the position of social icons.', THEME_NAME),
                        'options' => array('1' => 'Left', '2' => 'Right'),
                        'default' => '1'
                    ),


                    array(
                        'id'=>'val_header_social_icons',
                        'type' => 'select',
                        'title' => __('Select Social Icons @Header', THEME_NAME), 
                        'subtitle' => __('Please select social icons that you want to see @header.', THEME_NAME),
                        'required' => array('is_show_social_icons_at_header', '=' , '1'),
                        'multi' => true,
                        'sortable' => true,
                        'options' => array(
                            'facebook' => 'Facebook',
                            'twitter' => 'Twitter',
                            'google-plus' => 'Google Plus', 
                            'pinterest' => 'Pinterest',
                            'youtube' => 'Youtube',
                            'vimeo-square' => 'Vimeo',
                            'tumblr' => 'Tumblr',
                            'linkedin' => 'Linkedin',
                            'instagram' => 'Instagram',
                            'github' => 'GitHub',
                            'rss' => 'RSS' ),
                        'select2' => array('minimumResultsForSearch' => -1)
                ),

            array(
                'id'=>'is_show_contact_info',
                'type' => 'switch', 
                'title' => __('Contact Info @Header', THEME_NAME),
                'required' => array('is_header_top_on', '=' , '1'),
                'subtitle'=> __('Toggle it to show/hide contact information.', THEME_NAME),
                'default' => 0
            ),


                    array(
                        'id'=>'val_show_contact_info_position',
                        'type' => 'button_set', 
                        'title' => __('Contact Info Position', THEME_NAME),
                        'required' => array('is_show_contact_info', '=' , '1'),
                        'subtitle'=> __('Select the position of contact information.', THEME_NAME),
                        'options' => array('1' => 'Left', '2' => 'Right'),
                        'default' => '2'
                    ),

                    array(
                        'id'=>'is_show_phone',
                        'type' => 'checkbox',
                        'title' => __('Phone', THEME_NAME),
                        'required' => array('is_show_contact_info', '=' , '1'),
                        'subtitle' => __('Toggle it to show/hide phone number @Header.', THEME_NAME), 
                        'default' => '0'
                    ),

                    array(
                        'id'=>'is_show_fax',
                        'type' => 'checkbox',
                        'title' => __('Fax', THEME_NAME),
                        'required' => array('is_show_contact_info', '=' , '1'),
                        'subtitle' => __('Toggle it to show/hide fax number @Header.', THEME_NAME), 
                        'default' => '0'
                    ),

                    array(
                        'id'=>'is_show_email',
                        'type' => 'checkbox',
                        'title' => __('e-Mail', THEME_NAME),
                        'required' => array('is_show_contact_info', '=' , '1'),
                        'subtitle' => __('Toggle it to show/hide e-Mail @Header.', THEME_NAME), 
                        'default' => '0'
                    ),




    )
);

oztecnic avatar Mar 02 '14 20:03 oztecnic

The reason the reset section is now working on your social icons section, it because it's two levels deep inside your required fold. Currently, Redux only supports one level deep. The trade off was the `required' logic working properly. It's a known issue that will be addressed eventually. You'll have to keep your folding one level deep for it to work.

kprovance avatar Mar 02 '14 20:03 kprovance

Thank you Kevin, is there any road-map and date to fix this issue?

oztecnic avatar Mar 02 '14 21:03 oztecnic

Nope. When it's done. :)

kprovance avatar Mar 02 '14 22:03 kprovance