PDA

View Full Version : Ext.Form and initialization



fvinson
4 Jul 2012, 8:36 AM
Hello,
I have a grid panel
var gridReaction = Ext.create('Ext.ux.LiveSearchGridPanel', { .....

I have an action when the user mke selection on grid
gridReaction.getSelectionModel().on({
selectionchange: function(sm, selections) {
alect(selections[0].....}


I have a form panel in the same page
var reactionForm = Ext.create('Ext.form.Panel', {

layout: 'anchor', // Specifies that the items will now be arranged in columns
items: [{
fieldLabel: 'ec',
id :'ec',
text : 'ec',
dataIndex: 'ec',
xtype:'textfield',
},....

I want put a specific value in the textfield ec when the user select in grid

evant
4 Jul 2012, 8:02 PM
See: http://dev.sencha.com/deploy/ext-4.1.0-gpl/examples/form/form-grid.html

sword-it
4 Jul 2012, 10:00 PM
Hi!

See the sample code below:-





if (gridReaction.getSelectionModel().getSelected()) {
var record = gridReaction.getSelectionModel().getSelected().data;
YourScope.loadForm(record);
}






loadForm: function (record) {
var form = YourScope.getForm();
form.currentRecord = record;
form.loadRecord(record);
}