GIGJ.COM
welcome to my space
X
Welcome to:gigj.com
Search:  
Personal Injury | Languages | Soups | Photography | Email | Prepress | Exotic Locations | Computer Games | Related articles
NAVIGATION - HOME

Update FormPanel Data

Published by: webmaster 2009-01-07

  • Hi, i have a formPanel and load data in that one, now i want update data and doesn't works, i'm use firebug but doesn't show errors, here my code:



    Ext.onReady(function(){

    Ext.QuickTips.init();

    var actualizar = function() {
    var s=tabs.form.submit({
    failure: function() {
    Ext.MessageBox.alert('Status', 'Error');
    },
    success: function() {
    Ext.MessageBox.alert('Status', 'Success');
    }
    });
    };

    Ext.form.Field.prototype.msgTarget = 'side';

    var bd = Ext.getBody();

    var tabs = new Ext.FormPanel({
    labelWidth: 100,
    url:'http://localhost/prueba/Proyecto_Ext/actualizar.php',
    method: 'POST',
    title: 'Agregar Usuario',
    border:false,
    autoHeigth: true,
    width: 500,
    reader: new Ext.data.JsonReader({
    root: 'root',
    totalProperty: 'total',
    id: 'id'
    },[
    {name: 'id', mapping: 'id', type: 'int'},
    {name: 'cedula', mapping: 'cedula', type: 'string'},
    {name: 'nombre', mapping: 'nombre', type: 'string'},
    {name: 'apellido', mapping: 'apellido', type: 'string'},
    {name: 'id2', mapping: 'id2', type: 'int'},
    {name: 'empresa', mapping: 'empresa', type: 'string'},
    {name: 'direccion', mapping: 'direccion', type: 'string'},
    {name: 'telefono', mapping: 'telefono', type: 'string'}
    ]),

    items: {
    xtype:'tabpanel',
    activeTab: 0,
    deferredRender: false,
    layoutOnTabChange:true,
    defaults:{autoHeight:true, bodyStyle:'padding:10px'},
    items:[{
    title:'Datos Personales',
    layout:'form',
    defaults: {width: 270},
    defaultType: 'textfield',

    items: [{
    fieldLabel: 'Cedula',
    name: 'cedula',
    Ext: Help [Archive] - Page 18 - Ext JS Forums::
    EditorGrid: Update ENTIRE Row event. How to freeze a column in a grid, and prevent hide? Multiple data-sources --> 1 grid? documentation for FormPanel?
    http://extjs.com/forum/archive/index.php/f-9-p-18.html
    HOME
    allowBlank:false

    },{
    fieldLabel: 'Nombre',
    name: 'nombre'

    },{
    fieldLabel: 'Apellido',
    name: 'apellido'

    }]
    },{
    title:'Datos Laborales',
    layout:'form',
    defaults: {width: 270},
    defaultType: 'textfield',

    items: [{
    fieldLabel: 'Empresa',
    name: 'empresa'

    },{
    fieldLabel: 'Direccion',
    name: 'direccion'
    },{
    fieldLabel: 'Telefono',
    name: 'telefono'
    }]
    },{
    title:'Dirección de Habitación',
    layout:'form',
    defaults: {width: 270},
    defaultType: 'textfield',

    items: [{
    fieldLabel: 'Pais',
    name: 'pais'

    },{
    fieldLabel: 'Estado',
    name: 'estado'
    },{
    fieldLabel: 'Cod. Postal',
    name: 'postal'
    },{
    fieldLabel: 'Ciudad',
    name: 'ciudad'
    },{
    fieldLabel: 'Urbanizacion',
    name: 'urbanizacion'
    },{
    fieldLabel: 'Calle',
    name: 'calle'
    },{
    fieldLabel: 'Casa',
    name: 'casa'
    },{
    fieldLabel: 'No Casa/Apto',
    name: 'numcasa'
    }]
    },{
    title:'Numero de Telefonos',
    layout:'form',
    defaults: {width: 270},
    defaultType: 'textfield',

    items: [{
    fieldLabel: 'Celular',
    name: 'celular'

    },{
    fieldLabel: 'Habitacion',
    name: 'habitacion'
    },{
    fieldLabel: 'Trabajo',
    Ext: Help [Archive] - Page 53 - Ext JS Forums::
    Update Grid by refreshing store without data. treepanel adn IE incompatibilty Get combobox instance from a FormPanel. recup data from Json. Combo Box SetValue
    http://extjs.com/forum/archive/index.php/f-9-p-53.html
    HOME
    name: 'trabajo'
    },{
    fieldLabel: 'Contacto',
    name: 'contacto'
    }]
    }]
    },

    buttons: [{
    text: 'Save'
    handler: actualizar
    },{
    text: 'Cancel'
    }]

    });

    tabs.render(document.body);
    tabs.form.load({url:'http://localhost/prueba/Proyecto_Ext/cargar.php', method:'POST'});


    });


    please help me!!!:((


  • Don't use a Reader. It understands Json already.


  • Animal i did it your tips and doesn't work, here my code:




    Ext.onReady(function(){

    Ext.QuickTips.init();

    var actualizar = function() {
    var s=tabs.form.submit({
    /*url:'http://localhost/prueba/Proyecto_Ext/actualizar.php',
    method: 'POST',*/
    failure: function() {
    Ext.MessageBox.alert('Status', 'Error');
    },
    success: function() {
    Ext.MessageBox.alert('Status', 'Success');
    }
    });
    };

    Ext.form.Field.prototype.msgTarget = 'side';

    var bd = Ext.getBody();

    var tabs = new Ext.FormPanel({
    labelWidth: 100,
    url:'http://localhost/prueba/Proyecto_Ext/actualizar.php',
    method: 'POST',
    title: 'Agregar Usuario',
    border:false,
    autoHeigth: true,
    width: 500,
    /*reader: new Ext.data.JsonReader({
    root: 'root',
    totalProperty: 'total',
    id: 'id'
    },[
    {name: 'id', mapping: 'id', type: 'int'},
    {name: 'cedula', mapping: 'cedula', type: 'string'},
    {name: 'nombre', mapping: 'nombre', type: 'string'},
    {name: 'apellido', mapping: 'apellido', type: 'string'},
    {name: 'id2', mapping: 'id2', type: 'int'},
    {name: 'empresa', mapping: 'empresa', type: 'string'},
    {name: 'direccion', mapping: 'direccion', type: 'string'},
    {name: 'telefono', mapping: 'telefono', type: 'string'}
    ]),*/

    items: {
    xtype:'tabpanel',
    activeTab: 0,
    deferredRender: false,
    layoutOnTabChange:true,
    defaults:{autoHeight:true, bodyStyle:'padding:10px'},
    items:[{
    title:'Datos Personales',
    layout:'form',
    defaults: {width: 270},
    defaultType: 'textfield',

    items: [{
    fieldLabel: 'Cedula',
    name: 'cedula',
    allowBlank:false

    },{
    fieldLabel: 'Nombre',
    name: 'nombre'

    },{
    fieldLabel: 'Apellido',
    name: 'apellido'

    }]
    },{
    title:'Datos Laborales',
    layout:'form',
    defaults: {width: 270},
    defaultType: 'textfield',

    items: [{
    fieldLabel: 'Empresa',
    name: 'empresa'

    },{
    fieldLabel: 'Direccion',
    name: 'direccion'
    },{
    fieldLabel: 'Telefono',
    name: 'telefono'
    }]
    },{
    title:'Dirección de Habitación',
    layout:'form',
    defaults: {width: 270},
    defaultType: 'textfield',

    items: [{
    fieldLabel: 'Pais',
    name: 'pais'

    },{
    fieldLabel: 'Estado',
    name: 'estado'
    },{
    fieldLabel: 'Cod. Postal',
    name: 'postal'
    },{
    fieldLabel: 'Ciudad',
    name: 'ciudad'
    },{
    fieldLabel: 'Urbanizacion',
    name: 'urbanizacion'
    },{
    fieldLabel: 'Calle',
    name: 'calle'
    },{
    fieldLabel: 'Casa',
    name: 'casa'
    },{
    fieldLabel: 'No Casa/Apto',
    name: 'numcasa'
    }]
    },{
    title:'Numero de Telefonos',
    layout:'form',
    defaults: {width: 270},
    defaultType: 'textfield',

    items: [{
    fieldLabel: 'Celular',
    name: 'celular'

    },{
    fieldLabel: 'Habitacion',
    name: 'habitacion'
    },{
    fieldLabel: 'Trabajo',
    name: 'trabajo'
    },{
    fieldLabel: 'Contacto',
    name: 'contacto'
    }]
    }]
    },

    buttons: [{
    text: 'Save',
    handler: actualizar
    },{
    text: 'Cancel'
    }]

    });

    tabs.render(document.body);
    tabs.form.load({url:'http://localhost/prueba/Proyecto_Ext/cargar.php', method:'POST'});


    });



    Load data but not send for update

    1) Load data into formpanel for edit
    2) Edit data into form
    3) Send back data to server for update record





  • Nortel Unveils Vision, Strategy for Israeli High-Performance Net
    Busy Friday Leads to Strong Close for Net Stocks

  • easy cheap christmas gift ideas
  • i just got a new ipod and i thought
  • what 039 s your favorite martial arts move
  • do you have a crush
  • poll guys would you
  • would you like to do it like a parrot
  • quick survey what do you look for in the opposite
  • can someone please give me a hot and flashy name for my website
  • which ipod is best for the money
  • rumor phone charger help please
  • do you like the name haley
  • whats the name of the song that goes all i wana do is
  • what colors of makeup would i look good with
  • where does the toetag go on a dead person if they don 039 t have toes
  • hi i need help with my hair pics included
  • best primer you have ever used
  • leave fred durst alone
  • big mac or bk hamburgers
  • for those who like panic at the disco
  • english help please please
  • will it be as hard to get a wii this x mas then it was last year
  • help me with nouns please
  • is alanis morissette over rated
  • i suck at science im working on velocity you should help me dd
  • jonas brothers and miley cyrus
  • omj jonas brothers shirtless
  • do you wear contacts or glasses
  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Update FormPanel Data , Please add it free.
    About us |Contact us |Advertisement |Site map |Exchange links
    Copyright© 2008gigj.com All Rights Reserved