Hi all,

I am a newbie of extjs and do not know too much about extjs. I want to get values from data grid view in to the form textbox.

here is my code of app.js

Code:
Ext.require([
    'Ext.data.*',
    'Ext.form.*',
    'Ext.grid.*',
	'Ext.grid.Panel',
	
]);










Ext.onReady(function(){


    Ext.define('Person',{
        extend: 'Ext.data.Model',
        fields: [
            'salutation', 'title', 'firstName'
        ],
		
		
    });
    
	
    


    // create the Data Store
    var store = Ext.create('Ext.data.Store', {
        model: 'Person',
        autoLoad: true,
        proxy: {
            type: 'memory',
                data: getFormData(),
                reader: {
                    type: 'array'
                }
        }
    });


    // create the grid
    var billingGrid = Ext.create('Ext.grid.Panel', {
        store: store,
        columns: [
            {text: "salutation", width:120, dataIndex: 'salutation'},
            {text: "title", width: 120, dataIndex: 'title'},
			{text: "firstName", width: 120, dataIndex: 'firstName'}
        ],
        renderTo:'example-grid',
        width: 350,
        height: 180
    });
    
    
    
    var addUserForm = Ext.create('Ext.form.Panel', {
        renderTo: Ext.getBody(),
        bodyStyle: 'padding: 5px 5px 0 5px;',
        defaults: {
            xtype: 'textfield',
            anchor: '100%',
         },
        items: [{
            fieldLabel: 'salutation',
            name: 'salutation',
            maxLength: 64,            
            allowBlank: false,
            
            
        },{
            fieldLabel: 'Title',
            name: 'title',
            
            maxLength: 64,            
            allowBlank: false,
            
        },{
            fieldLabel: 'First Name',
            name: 'firstName',
            
            maxLength: 64,            
            allowBlank: true,
            
        }
        ,{
            fieldLabel: 'Address',
            name: 'address',
            
            maxLength: 64,            
            allowBlank: true,
            
        }],
        buttons: [{
            id: 'saveBtn',
            itemId: 'saveBtn',
            text: 'Submit',
            handler: function(btn, event) {
               // this.up('form').getForm().submit();
            	 
				var values= addUserForm.getValues();
				Ext.Msg.alert('Welcome', Ext.String.format('{0},{1},{2}',values.salutation,values.title,values.firstName));
				
                 // Create a record instance through the ModelManager
                 var r = Ext.ModelManager.create({
                	 salutation: values.salutation,
                     title: values.title,
                     firstName: values.firstName,
                     active: true
                 }, 'Person');


                 store.insert(0, r);
                 
            }
        },{
            text: 'Cancel',
            handler: function() {
                this.up('form').getForm().reset();
            }
        }],
        submit: function() {
        
            
            
        }
    }); //end of form creation
    
    
    
    function getFormData(){
	
							arrayData=[['Professor', 'Dr', 'Ghulam Murtaza']];
							return arrayData;
							}
							
							/* this.billingGrid.getSelectionModel().on('rowselect',function(sm,rowIdx,r){
							
							var selectedRecord = this.billingGrid.getSelectionModel().getSelected();
							if (selectedRecord !=null){
							
							var firstName= selectedRecord.get('firstName');
							
							}
							alert (firstName);
							}
							); */
							
							this.billingGrid.getSelectionModel().on('rowselect',function(sm, rowIdx, r){
    				var selectedRecord = this.billingGrid.getSelectionModel().getSelected();
    				if (selectedRecord != null){
    					 var firstName = selectedRecord.get('firstName');
						 alert(firstName);
    				}});
						
		});
thanks,
fadi.