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

Can't retrieve cloned Image Advanced selected value #860

Closed
tanftw opened this issue May 11, 2016 · 6 comments
Closed

Can't retrieve cloned Image Advanced selected value #860

tanftw opened this issue May 11, 2016 · 6 comments
Assignees

Comments

@tanftw
Copy link
Contributor

tanftw commented May 11, 2016

I have a clonable Image Advanced field (radio)

Now, I'll loop through each item and check if it's checked or not. I'm using this snippet:

$('.rwmb-image-select input').each(function() {
    console.log($(this).is(':checked'));
});

If I clicked on an item, then it's checked and all others aren't. Even though they're item on other radio group.

This should be same as radio, if I click on an item, all others in current group is unchecked instead of all other radio is unchecked.

@tanftw tanftw added the Bug label May 11, 2016
@funkatron82
Copy link
Contributor

What's the code for the field?

@tanftw
Copy link
Contributor Author

tanftw commented May 12, 2016

For example

<?php
$meta_boxes[] = array(
        'id'         => 'layout-content',
        'title'      => 'Contenido',
        'fields'     => array(
            array(
                'name'   => 'Select Layout',
                'id'     => 'item-row',
                'type'   => 'group',
                'clone'  => true,
                'fields' => array(
                    array(
                        'name'     => 'Layout',
                        'id'       => 'layout',
                        'required' => true,
                        'type'     => 'image_select',
                        'options'  => array(
                            'textimage' => get_bloginfo('template_url').'/images/settings/layout-textimage.png',
                            'imagetext' => get_bloginfo('template_url').'/images/settings/layout-imagetext.png',
                            'onlytext'  => get_bloginfo('template_url').'/images/settings/layout-text.png',
                            'onlyimage' => get_bloginfo('template_url').'/images/settings/layout-image.png',
                        ),
                    ),
                    array(
                        'name'    => 'Text',
                        'id'      => 'item-text',
                        'type'    => 'textarea',
                        'cols'    => 1,
                        'rows'    => 5,
                        'visible' => array( 'layout', 'in', array( 'onlytext', 'textimage', 'imagetext' ) ),
                    ),
                    array(
                        'name'      => 'Images',
                        'id'        => 'item-images',
                        'type'      => 'file_advanced',
                        'mime_type' => 'image',
                        'visible' => array( 'layout', 'in', array( 'onlyimage', 'textimage', 'imagetext' ) ),
                    ),
                ),
            ),
        ),
    );

rilwis pushed a commit that referenced this issue May 13, 2016
@rilwis
Copy link
Member

rilwis commented May 13, 2016

@Tanng I've just pushed a fix for this. The "selected" attribute is set correctly now (as it's saved correctly). Please check.

@rilwis rilwis self-assigned this May 13, 2016
@tanftw
Copy link
Contributor Author

tanftw commented May 17, 2016

Sorry, but still doesn't works

I've made a screen cast for more detail
http://recordit.co/xnrNf4sUbG

@rilwis
Copy link
Member

rilwis commented May 18, 2016

Hmm, here is my test http://recordit.co/WHSs33krqa, it looks fine. Can you please test with the latest version of both Meta Box (on Github) and Group extension?

@tanftw
Copy link
Contributor Author

tanftw commented May 18, 2016

Ok, it works with the latest Group version.

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

3 participants