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

Collection: DatePicker not available on new elements #119

Open
lionelbzv opened this issue May 12, 2014 · 5 comments
Open

Collection: DatePicker not available on new elements #119

lionelbzv opened this issue May 12, 2014 · 5 comments

Comments

@lionelbzv
Copy link
Contributor

I'm using an embed form in the admingeneratorgenerator bundle.

The embed form includes a datetime picker like that:

    edit:
        params:
            display:                
                NONE:               [ [ begin_at ], [ three_d, vo ] ]
            title:                  "Nouvelle séance"  # title has to be defined to avoid errors, but is not used
            fields:
                begin_at:
                    formType:       afe_datetime_picker

When I edit the embed collection, all works fine,but when I add new elements to this embed collection, the datepicker UI is not available, and I've got to put the date manually.

@ioleo
Copy link
Member

ioleo commented May 19, 2014

Please provide also the formOptions for the collection (new/edit).

PS. Sorry for weeks delay. I was in a hospital.

@lionelbzv
Copy link
Contributor Author

here's the collection options (edit only, i'm not using it on new object):

                cinema_session_dates:
                    dbType:                     collection
                    formType:                   afe_collection_table
                    label:                      Liste des séances du film
                    addFormOptions:
                        type:                   \MyProject\AdminBundle\Form\Type\CinemaSessionDate\EditType
                        allow_add:              true
                        allow_delete:           true
                        by_reference:           false
                        new_label:              " - Nouvelle séance"
                        options:
                            data_class:         AxAnim\Model\CinemaSessionDate

PS: hope you're healthy now!

@ioleo
Copy link
Member

ioleo commented May 20, 2014

@StudioEcho I see nothing wrong with the yaml configs. Do you have any custom options in form PHP class? (custom getFormOptions method)?

@lionelbzv
Copy link
Contributor Author

Form\Type\EditType:

/**
 * EditType
 */
class EditType extends BaseEditType
{
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        // parent::setDefaultOptions($resolver); 
        $resolver->setDefaults(array(
            'data_class' => 'MyProject\Model\CinemaSessionDate' 
            ));
    }

    public function getName()
    {
        return 'cinema_session_date';
    }
}

@ioleo
Copy link
Member

ioleo commented May 20, 2014

@StudioEcho i have no idea where the bug might come from, i'll have to setup a project to test it, i'll leave a comment if i find anything

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

2 participants