ExtJS: Fill a field form with a grid

Hi, people
I’m starting with javascript and I have a doubt.
I already have a grid with data and a form with 5 fields.
One of these fields of the form I want to fill with data of the grid.

This is what I have:


sm: new Ext.grid.RowSelectionModel({
				  singleSelect: true,
				  listeners: {
				   rowselect: function(sm, row, rec) {
				    form.getForm().loadRecord(rec);
				   }
				  }
				 })

But this way the entire form is filled with the data of the grid.
What I want is that when the user click on the row, only the first column of that row is sent to the specific field of the form.
Does anyone know how to do this?

It looks like you’re using some kind of code library for this. Can you share with us which code library you are using, so that someone who knows about that code library can help?

ExtJS

I have modified the thread summary, so that if anyone knows about ExtJS you will be more likely to receive some help from them.

I got it!

var fieldForm = Ext.getCmp(‘idFieldForm’);
fieldForm.setValue(rec.get('‘fieldNameOnStore’));