1. #1
    Sencha User
    Join Date
    Mar 2011
    Posts
    18
    Vote Rating
    0
    lobosan is on a distinguished road

      0  

    Default Unanswered: Fill Form with data from database

    Unanswered: Fill Form with data from database


    Hi everyone, i made a big form with ext designer and now i need to fill the data depending on the parameter passed on the url (example: mydomain.com/sisconse/designer.html?idform=1)

    So depending of the idform i need to make a query to the database, generate the json and fill the form, the json is ready (app/data/loadform.php sisconse.zip) but i don't know how to use it to fill the form "FichaSenagua"

    I hope someone can help me

    Thanks in advance

  2. #2
    Sencha User
    Join Date
    Nov 2007
    Posts
    29
    Vote Rating
    0
    joseph09 is on a distinguished road

      0  

    Default


    http://docs.sencha.com/ext-js/4-0/#!...rm.action.Load

    Code:
                formPanel.load({
                    url: 		'/path/to/file.php, 
                    method: 	'POST',
                    params: {
                        id:       id, 
                        foo:     'bar',
                        action: 'loadForm' 
                    },
                    waitMsg: 	'Loading...',
                    success:	function(form, action) {
                   	}
                });

  3. #3
    Sencha User
    Join Date
    Mar 2011
    Posts
    18
    Vote Rating
    0
    lobosan is on a distinguished road

      0  

    Default


    Hi Joseph, thanks for answering

    I was trying to make it work but i can't because i don't know where exactly put the code, i hope you can help me

    Here is the code generated by the ext designer

    1. designer.js
    Code:
    Ext.Loader.setConfig({
        enabled: true
    });
    
    
    Ext.application({
        name: 'sisconse',
    
    
        stores: [
            'MyArrayStore'
        ],
    
    
        launch: function() {
            Ext.QuickTips.init();
    
    
            var cmp1 = Ext.create('sisconse.view.FichaSenagua', {
                renderTo: Ext.getBody()
            });
            cmp1.show();
        }
    });
    2. FichaSenagua.js
    Code:
    Ext.define('sisconse.view.FichaSenagua', {
        extend: 'sisconse.view.ui.FichaSenagua',
    
    
        initComponent: function() {
            var me = this;
            me.callParent(arguments);
        }
    });
    3. FichaSenagua.js (in ui folder)
    Code:
    Ext.define('sisconse.view.ui.FichaSenagua', {
        extend: 'Ext.form.Panel',
        requires: [
            'sisconse.view.Cabecera
        ],
    
    
        frame: true,
        height: 3227,
        id: 'FichaSenagua',
        width: 1260,
        autoScroll: true,
        layout: {
            type: 'absolute'
        },
        bodyPadding: 10,
        title: 'INFORMACION DE LOS USOS Y APROVECHAMIENTOS HIDRICOS DEL ECUADOR',
    
    
        initComponent: function() {
            var me = this;
            me.items = [
                {
                    xtype: 'cabecera',
                    x: 0,
                    y: 0,
                    height: 194,
                    itemId: 'Cabecera',
                    width: 1244,
                    layout: {
                        type: 'absolute'
                    }
                }
            ];
            me.callParent(arguments);
        }
    });
    4. Cabecera.js (in this file is the field "CbFormularioNo" that i want to fill with the json data)
    Code:
    Ext.define('sisconse.view.ui.Cabecera', {
        extend: 'Ext.form.FieldContainer',
    
    
        height: 194,
        width: 1244,
        layout: {
            type: 'absolute'
        }
    
    
        initComponent: function() {
            var me = this;
            me.items = [
                {
                    xtype: 'numberfield',
                    width: 200,
                    inputId: 'CbFormularioNo',
                    name: 'CbFormularioNo',
                    fieldLabel: 'FORMULARIO No',
                    labelAlign: 'right',
                    minValue: 1,
                    x: 790,
                    y: 10
                }
            ];
            me.callParent(arguments);
        }
    });
    5. loadform.php
    Code:
    <?php
    header("Content-Type: text/plain");    
        
    $data = array(
        array('CbFormularioNo'=>'Hola')
    );
    $info = array(
        'success'=>true,
        'data'=> $data
    );
    
    
    echo json_encode($info);

Thread Participants: 1

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