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

Sortable + collection upload with doctrine ORM #143

Open
nicoip opened this issue Aug 12, 2014 · 10 comments
Open

Sortable + collection upload with doctrine ORM #143

nicoip opened this issue Aug 12, 2014 · 10 comments
Labels

Comments

@nicoip
Copy link

nicoip commented Aug 12, 2014

Hello,

I use avocode upload widget for collection (afe_collection_upload).

I want to use sortable of l3pp4rd/DoctrineExtensions, I followed the tutorials, but the drop down does not appear. When I save my entity, the order of images is 0,1,2,3,4 ...
But the drop down can not be displayed :(

Do you have an idea?

Thank you

@ioleo
Copy link
Member

ioleo commented Aug 12, 2014

What dropdown do you have in mind? I don't recall any dropdowns in afe_collection_upload widget.

@nicoip
Copy link
Author

nicoip commented Aug 12, 2014

Yes afe_collection_upload.
I would use the sortable with afe_collection_upload. but nothing happens

@ioleo
Copy link
Member

ioleo commented Aug 12, 2014

If you've configured everything correctly, then "drag and drop" uploaded items to set their order.

Note: this works on items already saved on the server. New files (selected for upload) have to be uploaded and saved first.

@nicoip
Copy link
Author

nicoip commented Aug 12, 2014

Yes I know ... The configuration is correct.

@ioleo
Copy link
Member

ioleo commented Aug 12, 2014

@nicoip Please paste the related generator.yml

@nicoip
Copy link
Author

nicoip commented Aug 13, 2014

hi,

generator: admingenerator.generator.doctrine
params:
    ...
    embed_types:
       # short syntax
       - "ImageAdmin-generator.yml" 
    pk_requirement: ~
    fields:
       ...
      images:
        label:            Images
        dbType:           collection
        formType:         afe_collection_upload
        addFormOptions:
            primary_key:          id
            nameable:             false
            sortable:             true
            sortable_field:       position
            editable:             [ legende, path, position ]
            type:                 \Test\GalleryBundle\Form\Type\ImageAdmin\EditType
            maxNumberOfFiles:     99
            maxFileSize:          5000000
            minFileSize:          1000
            acceptFileTypes:      /(\.|\/)(gif|jpe?g|png)$/i
            loadImageFileTypes:   /^image\/(gif|jpe?g|png)$/i
            loadImageMaxFileSize: 2500000
            previewMaxWidth:      100
            previewMaxHeight:     100
            previewAsCanvas:      true
            previewFilter:        thumb_gallery_images
            prependFiles:         false
            allow_add:            true
            allow_delete:         true
            error_bubbling:       false
            options:
                data_class:       Test\GalleryBundle\Entity\Image

capture

the checkboxes are disabled

Thank you

@ioleo
Copy link
Member

ioleo commented Aug 13, 2014

  1. I'm sorry, but I don't understand what exacly is the problem? Please explain more verbose. At first you say you wanted to use sortable "but nothing happens" - I assumed the sorting is not working. Now you say the checkboxes are disabled - is that the problem?

  2. The rendered output looks OK.

  3. The checkboxes are for "batch delete" (the delete button on top bar, next to "add files"). Clicking that button should delete all "checked" files.

  4. Have a look at browser console. Are there any Javascript errors? Maybe you have some Javascript error (in some other script), which often leads to breaking current Javascript runtime and may break other scripts.

@nicoip
Copy link
Author

nicoip commented Aug 13, 2014

Thank you for your reply.

I'm sorry,
there are two problems:
First: I can not order my images with a "drag and drop"
Secondly: the checkbox for "batch delete" are disabled

I looked at the console, I see no error. I did not create my own scripts

@ioleo
Copy link
Member

ioleo commented Aug 13, 2014

@nicoip Sorry.. I don't speak french...

@nicoip
Copy link
Author

nicoip commented Aug 13, 2014

Sorry, I changed my message

@ioleo ioleo added the bug label Aug 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants