Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work on nested items #34

Open
fakeartist opened this issue Nov 18, 2016 · 1 comment
Open

Does not work on nested items #34

fakeartist opened this issue Nov 18, 2016 · 1 comment

Comments

@fakeartist
Copy link

fakeartist commented Nov 18, 2016

Hi! First of all, an excellent addition to cmb2!

I have the following settings:

    $event_metaboxes->add_field(array(
        'id' => $prefix . 'repeatable',
        'name' => 'Repeatable event',
        'type' => 'radio_inline',
        'options' => array(
            'yes' => __('Yes', 'cmb2'),
            'no' => __('No', 'cmb2'),
        ),
        'default' => 'no',
    ));

    $event_metaboxes->add_field(array(
        'id' => $prefix . 'repetition',
        'name' => __('Event repetion', 'cmb2'),
        'type' => 'radio',
        'options' => array(
            'daily' => __('Daily', 'cmb2'),
            'weekly' => __('Weekly', 'cmb2'),
            'monthly' => __('Monthly', 'cmb2'),
            'yearly' => __('Yearly', 'cmb2'),
        ),
        'default' => 'daily',
        'attributes' => array(
            'data-conditional-id' => $prefix . 'repeatable',
            'data-conditional-value' => 'yes',
        ),
    ));
    
    $event_metaboxes->add_field(array(
        'id' => $prefix . 'repetition_daily',
        'name' => __('Event repetion', 'cmb2'),
        'type' => 'radio',
        'options' => array(
            'n' => __('Every N day', 'cmb2'),
            'workday' => __('Every workday', 'cmb2'),
        ),
        'default' => 'n',
        'attributes' => array(
            'data-conditional-id' => $prefix . 'repetition',
            'data-conditional-value' => 'daily',
        ),
    ));

The problem is this: When I click the Yes radio on the first field, the second field opens, but is should also open the 3rd field, but it does not. Any ideas what might be wrong?

@fakeartist fakeartist changed the title Does in work on nested items? Does not work on nested items Nov 21, 2016
@fakeartist
Copy link
Author

Also, as a side notice, when the page opens for the first time, the nested conditional logic works great! The problem is, when you later click weekly and the 'No' radio button of the 1st field, and then again the 'Yes' radio button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant