select2 in new and edit form

272 views
Skip to first unread message

Cesar Cardenas

unread,
Nov 26, 2013, 1:39:08 PM11/26/13
to symfony2adm...@googlegroups.com

Hi im having troubles whit select2 of FormExtensions i follow all instruccion in https://github.com/avocode/FormExtensions/issues/22, but it give me the next error:

Notice: Undefined property: Acme\DemoBundle\Form\Type\Demanda\NewType::$router in C:\xampp\htdocs\sample\src\Acme\DemoBundle\Form\Type\Demanda\NewType.php line 56

also having error in all the lines that call router and translator
url: "'.$this->router->generate("queryConferences").'",
$.get('".$this->router->generate('queryInitialConference', array('id' => $this->application->getConference()->getId()))."', {}, function(data){
'placeholder' => $this->translator->trans("query.conference", array(), 'ConferenceApplication'),

im using newtype insted of edit type but i don tink it make a big difference
i add use \Symfony\Bundle\FrameworkBundle\Routing\Router; to mu NewType.php but not working

The json part is working nice but i cant render the new or edit form whiout replacing $this->ruoter for ruotes created in my routing.yml. when i put the exact route like /querryClientes it work but is not the best way to do it and jut display the form an not the select2 field (seems to be hidden whe i cheek htm).

also in my generator.ym in field have the next 

cliente:
            label: Cliente
            getter: cliente.nombre
            filterOn: cliente
            formType: afe_select2_entity
            addFormOptions:
                #class: Acme\DemoBundle\Entity\Persona
                property: nombre
                autocomplete: true
                required: true
I try using afe_select2_choice but not luck whit thisso im oficialy lost 
any help would be apreciated:

pd: i post here and in github because github issue was old and i dont know if sombody read the old issues 
Reply all
Reply to author
Forward
0 new messages