SontaAdmin problem with ManyToOne relation

218 views
Skip to first unread message

marc morales

unread,
Aug 6, 2012, 10:53:36 AM8/6/12
to sonata...@googlegroups.com
Hello,

I have a entity with @ORM\ManyToOne(targetEntity="LoPati\MenuBundle\Entity\Categoria")

protected function configureFormFields(FormMapper $formMapper)

{

$formMapper

->add('nom', null, array('label' => 'Nom'))

->add('ordre', null, array('label' => 'Ordre'))

->add('actiu', null, array('label' => 'Actiu'))

->add('categoria', 'sonata_type_model',array('expanded' => false));

}

I have this configuration in sevices.yml

  sonata.lopati.admin.subcategoria:

    class: LoPati\MenuBundle\Admin\SubCategoriaAdmin

    tags:

      - { name: sonata.admin, manager_type: orm, group: 'Menu', label: Sub-Categoria }

    arguments:

      - null

      - LoPati\MenuBundle\Entity\SubCategoria

      - MenuBundle:Admin


SonataAdmin create de form but I have the problem that when I click to + icon (to add new Categoria) not open the window to create new categoria,

In chrome console write this error: 

[Sonata.Admin] [object Object] base.js:19
[Sonata.Admin] [s501fd9f9bbc11_categoria|field_dialog] move dialog container as a document child base.js:19
[Sonata.Admin] [s501fd9f9bbc11_categoria|field_dialog_form_add] add link action base.js:19
[Sonata.Admin] [s501fd9f9bbc11_categoria|field_dialog_form_add] ajax success, [object Object] base.js:19
Uncaught TypeError: Object [object Object] has no method 'dialog' create:309





When is the error?

Thanks

Regards
 

marc morales

unread,
Aug 6, 2012, 11:10:44 AM8/6/12
to sonata...@googlegroups.com
Sorry.

In chrome console write this error: 

[Sonata.Admin] [object Object] base.js:19
[Sonata.Admin] [s501fdd60e145c_categoria|field_dialog] move dialog container as a document child base.js:19
[Sonata.Admin] [s501fdd60e145c_categoria|field_dialog_form_add] add link action base.js:19
[Sonata.Admin] [s501fdd60e145c_categoria|field_dialog_form_add] ajax success, [object Object] base.js:19
    1. Uncaught TypeError: Object [object Object] has no method 'dialog' create:309
      1. jQuery.ajax.successcreate:309
      2. f.Callbacks.njquery.min.js:2
      3. f.Callbacks.o.fireWithjquery.min.js:2
      4. f.support.ajax.f.ajaxTransport.send.djquery.min.js:4

    Thanks a lot!

    Regards

    jean...@gmail.com

    unread,
    Aug 6, 2012, 11:14:57 AM8/6/12
    to sonata...@googlegroups.com
    Please verify if jqueryui.xxxx.js with the plugin "dialog" is loaded.

    Tks

    2012/8/6 marc morales <metalr...@gmail.com>

    Regards

    --
    You received this message because you are subscribed to the Google Groups "sonata-users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/sonata-users/-/EVuruo8SOncJ.

    To post to this group, send email to sonata...@googlegroups.com.
    To unsubscribe from this group, send email to sonata-users...@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/sonata-users?hl=en.



    --
    Atenciosamente,
    Jean Carlos

    info...@gmail.com

    unread,
    Mar 26, 2013, 10:20:27 AM3/26/13
    to sonata...@googlegroups.com
    Conseguiste solucionar este tema?.  Estoy yo con lo mismo y no se qué hacer.
    Reply all
    Reply to author
    Forward
    0 new messages