0

I am creating a CMS with Symfony2 and SonataAdminBundle.

When I put this:

->add('tags', 'sonata_type_model', array('expanded' => true))

I get the + button but when I click the button I get JS error: "Object [object Object] has no method 'dialog'"

Does anyone know why?

Mauro
  • 1,447
  • 1
  • 26
  • 46
  • Whats your Association mapping? What happens if you only give ->add('tags')? You may need 'sonata_type_collection' but need details to suggest. – Amit May 23 '12 at 05:57
  • If I put ->add('tags') I get a mutiple select with all the tags. that's right... – Mauro May 23 '12 at 14:36
  • Have you solved the "Object [object Object] has no method 'dialog'" problem? I have the same issue here with `->add('tags', 'sonata_type_model', array('expanded' => true, 'by_reference' => false, 'multiple' => true, 'required' => false))`. – oscarmlage Apr 02 '13 at 08:25
  • I'm sorry but.. not :-(. Leaved Sonata and using Crud Symfony generator at the moment – Mauro Apr 02 '13 at 12:08

1 Answers1

0

In my case the reason of this problem was included jquery file (jquery-2.0.2.min.js) after bundle script files.

Try to remove extra ui/jquery core files that loaded after sonata files:

        <script src="/bundles/sonatajquery/jquery-1.8.3.js" type="text/javascript"></script>
        <script src="/bundles/sonatajquery/jquery-ui-1.8.23.js" type="text/javascript"></script>
        <script src="/bundles/sonatajquery/jquery-ui-i18n.js" type="text/javascript"></script>

Hope this helps

drcreazy
  • 1
  • 3