1. #1
    Sencha User 123lal's Avatar
    Join Date
    Feb 2012
    Posts
    32
    Vote Rating
    0
    123lal is on a distinguished road

      0  

    Question load json to a form panel

    load json to a form panel


    hi
    am a new ext js4 user
    i tried examples that is loaded with ext js4 mvc architecture, i haven't found any form submission and edit that data in the same form for update , i tried many time, may be because of my lack of knowledge i failed, does any one have the sample code to test it , please help me . and one more is that possible to load json data in to a form that uses text field.

    thank you , phm

    this is my code
    // JavaScript Document
    Ext.define('AM.view.user.UserFormPanel', {
    extend : 'Ext.form.Panel',
    alias : 'widget.UserFormPanel',

    title : 'Employee Form',
    // height : 130,
    width : 280,
    defaults : {
    anchor : '5',
    labelWidth : 70
    },
    initComponent : function() {


    this.items = [
    {
    xtype: 'form',
    store: 'employees',
    items: [
    {
    xtype: 'textfield',
    name : 'name',
    fieldLabel: 'Name'
    },
    {
    xtype: 'textfield',
    name : 'email',
    fieldLabel: 'Email'
    },
    {
    xtype : 'textfield',
    fieldLabel : 'First Name',
    name : 'firstName'
    },
    {
    xtype : 'textfield',
    fieldLabel : 'Last Name',
    name : 'lastName'
    },
    {
    xtype : 'datefield',
    fieldLabel : 'DOB',
    name : 'dob'
    },
    {
    xtype : 'combobox',
    store : 'States',
    queryMode : 'local',
    displayField: 'name',
    valueField : 'abbr',
    fieldLabel : 'State',
    name : 'state'
    },
    {
    xtype : 'button',
    text : 'Load',
    //action : 'load',
    //,
    handler: function() {
    var form = this.up('form').getForm();
    form.load({
    models: 'employee',
    type: 'ajax',
    url: 'data/form.json',
    reader: {
    type: 'json',
    root: 'users'
    },
    success: function(form, action) {
    Ext.Msg.alert('Success', 'Form loaded.');
    },
    failure: function(form, action) {
    Ext.Msg.alert("Load failed", action.result.errorMessage);
    }
    });
    }
    },
    {
    xtype : 'button',
    text : 'Submit',
    //action : 'submit',
    handler : function() {
    var form = this.up('form').getForm();
    form.submit({
    url: 'form-submit.php',
    waitMsg: 'Sending the info...',
    success: function(fp, o) {
    Ext.Msg.alert('Success', 'Form submitted.');
    }
    });
    }
    }
    ]
    }
    ];

    //this.items = this.buildItems();
    this.callParent();
    },


    });

  2. #2
    Sencha User 123lal's Avatar
    Join Date
    Feb 2012
    Posts
    32
    Vote Rating
    0
    123lal is on a distinguished road

      0  

    Question is there any code to edit data in form

    is there any code to edit data in form


    i found code to edit data in grid is there any code to edit data in form..

    am new to extjs, am a php developer, my aim is to use extjs as front end and php as back end, first of all i would like to create a form which has to enter some data to database and has to retrieve that data for editing in that same form, please help if some one know the code and the way to program in ext js

    Thank you for considering

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    1
    Vote Rating
    0
    Shaemar98 is on a distinguished road

      0  

    Default


    Thanks for the kind welcomes.....made my day! my grouchy old cat likes things her way..period...she is one of a kind (we all say that dont we?!) actually we are tied at the hip so even look a bit alike, being a bit portly....i had my last "tied at the hip" friend till he was 18 yrs. old...bluepoint siamese...jees i loved that cat..i still see him around and its been 20 yrs since he walked through the veil. i will see if i can get some pix on soon...of dogs too...got some awesome photos...just have to figure it out how to put them on...i am old but not stupid so who knows, maybe even today!!!!! had the dogs since they were wee little puppies, so they are still my babies...

    jeux d'habillage

  4. #4
    Sencha User 123lal's Avatar
    Join Date
    Feb 2012
    Posts
    32
    Vote Rating
    0
    123lal is on a distinguished road

      0  

    Exclamation SPAM BY jeux d'habillage

    SPAM BY jeux d'habillage


    Shaemar98


    please dont put unwanted messages

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar