cake-php
[Arriba] [Todas las Listas]

Cuándo i selecciona gota próxima estatal abajo la lista de contactos d

To: cake-php@xxxxxxxxxxxxxxxx
Subject: Cuándo i selecciona gota próxima estatal abajo la lista de contactos da sólo uno valora relacionado para declarar no dando todos los contactos relacionados para declarar
From: sneha kulkarni <sneha.kulkarni122@xxxxxxxxx>
Date: Wed, 5 Jun 2013 12:53:52 +0530
Delivery-date: Wed, 05 Jun 2013 03:24:05 -0400
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=x-beenthere:mime-version:date:message-id:subject:from:to :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-google-group-id:list-post :list-help:list-archive:sender:list-subscribe:list-unsubscribe :content-type; bh=mmJoNbt1Ctfqqo23mQTaGuepRjngpj5FFEXCOCvNWbw=; b=a1PbDN9/RX8kUBYy9Vre29xYWAfqoyMz6+UGmUjV1QsPUsfUzcKCGzprohuuK8/DR2 Ji9nnSscdjWHJPb2j1mwnUpN7PTt0zLfqu2WpqQgxrXAsjt0aQ5l/JW7uCYqfKx6Uld5 XwfwKwXiUbdTPCEJr+K6WHmVXjmJCRQRImrv7p/OlgqFUCd+aS2jl9OfZB8EedFKq6eY 9otlHFiGMZSqy52GcPIrFllFTn87w9ddI7+9RbsXIgAi07OOESohC0SBkE8Eku3VDMP/ XtaU/ANazjMSzNB5NkMJlpxGcW3lXq5KwqI9vc95H6JdD7C72hgFJo74ZqYRt3VAtZEf gZrA==
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-beenthere:mime-version:date:message-id:subject:from:to :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-google-group-id:list-post :list-help:list-archive:sender:list-subscribe:list-unsubscribe :content-type; bh=mmJoNbt1Ctfqqo23mQTaGuepRjngpj5FFEXCOCvNWbw=; b=dsnUQZTUNB8eOV2/11blPWCDvJuv+9NSMwEF9WduVZrkGZH/U9+/y9NWHzEd04Zpi6 fLK6ml0P7cyJysWQ+9Ut8WP9enFTB/Bu1bRenjaFyGhZqM2vHXBVtQ5SVTIhAZqj1N8w kuN3A4ve8p6PSWuCrRHY6sK+iciAotb1HocGuIAqTI2Pdh1Em2FS2JMZHjTFV58bQHYn nkrHljZr+VmVk1j0wbeDNwtIwCdX/ajsZdhE3Z0QNZBphRdAHbgq/tI3tNtrf/Yy9Wb/ FCSdXSDYGwB/C0tC7dIMELkD62w/VX1GljxwqBS0PHspZeN4jqOk5io7TkwnvWnSHC+h lAmA==
Envelope-to: traductor@xxxxxxxxxxx
List-archive: <http://groups.google.com/group/cake-php?hl=en>
List-help: <http://groups.google.com/support/?hl=en>, <mailto:cake-php+help@googlegroups.com>
List-id: <cake-php.googlegroups.com>
List-post: <http://groups.google.com/group/cake-php/post?hl=en>, <mailto:cake-php@googlegroups.com>
List-subscribe: <http://groups.google.com/group/cake-php/subscribe?hl=en>, <mailto:cake-php+subscribe@googlegroups.com>
List-unsubscribe: <http://groups.google.com/group/cake-php/subscribe?hl=en>, <mailto:googlegroups-manage+1003367825667+unsubscribe@googlegroups.com>
Mailing-list: list cake-php@xxxxxxxxxxxxxxxx; contact cake-php+owners@xxxxxxxxxxxxxxxx
Reply-to: cake-php@xxxxxxxxxxxxxxxx
Sender: cake-php@xxxxxxxxxxxxxxxx
*hi..

*i Tiene referir el siguiendo *tutorial para *dependent *dropdown archivo

de lista:///*C:/Documentos%20y%20*Settings/*examsever/*Desktop/3*rdjune13/Utilizando%20*AJAX%20y%20*CakePHP%20a%20*dynamically%20puebla%20selecciona%20forma%20campos%20_%20Jan.*htm


Cuándo *i selecciona gota próxima estatal abajo la lista de contactos da sólo uno valora
relacionado para declarar
no dando todos los  contactos relacionados para declarar.*plz Ayuda si las Mesas

posibles

declara  contactos
 *id       *id
el nombre     nombra
         estatal_*id



En




<Vista ?*php Repite $esto->Forma->crear('Contacto');
eco $esto->Forma->entrada('Contacto.Estatal_*id', variedad('etiqueta' => 'estatal',
'vacío' => '-- Elegir un contacto --','opciones'=>$estados));
eco $esto->Forma->entrada('Contacto.*id', variedad('etiqueta' => 'contacto', 'vacío'
=> '-- Elegir un estatal --','tipo'=>'selecciona'));
eco $esto->Forma->fin('Entrega');
?>



<?*php
$Esto->*Js->conseguir('#*ContactStateId')->acontecimiento(
    'cambio',
    $esto->*Js->petición(
        variedad('controlador'=>'contactos','acción'=>'*ajax_contactos'),
        variedad('actualiza' => '#*ContactId', '*dataExpression' => cierto, 'datos' =>
'$("#*ContactStateId").*serialize()')
    )
);

?>



En función


de Controlador *ajax_contactos()

    $#prn->conjunto('opciones',
        $esto->Contacto->encontrar('lista',
            variedad(
                'condiciones' => variedad(
                    'Contacto.*id' =>
$Este->*params['*url']['datos']['Contacto']['estatal_*id']
                )
            )
        )
    );
    $esto->*render('/elementos/*ajax_*dropdown', '*ajax');
}



*ajax_*dropdown.*ctp


<?*php *foreach($Opciones como $clave => $*val) #punt>
<Valor de opción="<?*php Llave $de eco; ?>"><?*php Eco $*val; ?></Opción>
<?*php } ?>

-- 
Gustarnos en *FaceBook *https://www.facebook.com/*CakePHP
nos Encuentra en *Twitter *http://*twitter.*com/*CakePHP

--- 
Recibiste este mensaje porque eres *subscribed al *Google Grupos "*CakePHP" grupo.
A *unsubscribe de este grupo y la parón que recibe *emails de él, enviar un *email a pastel-*php+unsubscribe@xxxxxxxxxxxxxxxx.
A correo a este grupo, envía *email a pastel-php@xxxxxxxxxxxxxxxx.
Visita este grupo en *http://grupos.*google.*com/Pastel/de grupo-*php?*hl=*en.
Para más opciones, visita *https://grupos.*google.*com/Los Grupos/optan_fuera.


hi..

i have refer the following tutorial for dependent dropdown list

file:///C:/Documents%20and%20Settings/examsever/Desktop/3rdjune13/Using%20AJAX%20and%20CakePHP%20to%20dynamically%20populate%20select%20form%20fields%20_%20Jan.htm


when i select state next drop down list of contacts gives only one value
related to state
not giving all contacts related to state.plz help if possible

Tables

states  contacts
 id       id
name     name
         state_id



In View




<?php echo $this->Form->create('Contact');
echo $this->Form->input('Contact.state_id', array('label' => 'state',
'empty' => '-- Pick a contact --','options'=>$states));
echo $this->Form->input('Contact.id', array('label' => 'contact', 'empty'
=> '-- Pick a state --','type'=>'select'));
echo $this->Form->end('Submit');
?>



<?php
$this->Js->get('#ContactStateId')->event(
    'change',
    $this->Js->request(
        array('controller'=>'contacts','action'=>'ajax_contacts'),
        array('update' => '#ContactId', 'dataExpression' => true, 'data' =>
'$("#ContactStateId").serialize()')
    )
);

?>



In Controller


function ajax_contacts() {

    $this->set('options',
        $this->Contact->find('list',
            array(
                'conditions' => array(
                    'Contact.id' =>
$this->params['url']['data']['Contact']['state_id']
                )
            )
        )
    );
    $this->render('/elements/ajax_dropdown', 'ajax');
}



ajax_dropdown.ctp


<?php foreach($options as $key => $val) { ?>
<option value="<?php echo $key; ?>"><?php echo $val; ?></option>
<?php } ?>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to cake-php@xxxxxxxxxxxxxxxx.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


<Anterior por Tema] Tema Actual [Siguiente por Tema>