Ver Mensaje Individual
  #7 (permalink)  
Antiguo 30/01/2013, 13:15
Montes28
 
Fecha de Ingreso: septiembre-2010
Mensajes: 1.853
Antigüedad: 13 años, 6 meses
Puntos: 6
Respuesta: X-editable leer valores desde base de datos

maycolalvarez gracias por responder , disculpame estoy un poco confundido y no me funciona lo que me indicaste

estoy viendo la documentacion del plugin
http://vitalets.github.com/x-editable/docs.html en $().editable(options)

Name:value
Type:mixed
Default: element's text
Description:Initial value of input. If not set, taken from element's text.


segun el ejemplo que hay en el plugin se llenan los input con un array json
Código Javascript:
Ver original
  1. <script>
  2. $(function(){
  3. $('#address').editable({
  4. url: '/post',
  5. title: 'Enter city, street and building #',
  6. value: {
  7. city: "Moscow",
  8. street: "Lenina",
  9. building: "15"
  10. }
  11. });
  12. });
  13. </script>

me corriges si estoy equivocado , hice lo que me indicaste y no me funciona

Código Javascript:
Ver original
  1. $('#address').editable({
  2.         url: 'multiples.php',
  3.         title: 'Enter city, street and building #',
  4.         value:function() {
  5.            $.ajax({
  6.            url: "datos.php",
  7.            type: json,
  8.            sucess: function( resultado){
  9.            }
  10.            });
  11.          
  12.          },
  13.    
  14.     });


Código PHP:
Ver original
  1. <?php
  2. $arr = array('city' => 'Moscow', 'street' => 'Lenina', 'building' => 15);
  3.  
  4. die( json_encode($arr));

Última edición por Montes28; 31/01/2013 a las 06:58