In MyView.js which is in the view directory I have this field userName.
Here is a bit of my code:
Code:
Ext.define('myapp.view.MyView, {
extend: 'Ext.panel.Panel',
alias: 'widget.myview, width: 400,
title: 'Input',
initComponent: function() {
var me = this;
Ext.applyIf(me, {
items: [
{
xtype: 'fieldcontainer',
height: 292,
width: 300,
layout: {
type: 'absolute'
},
fieldLabel: '',
hideLabel: true,
items: [
{
xtype: 'textfield',
x: 35,
y: 45,
fieldLabel: 'UserName',
name: 'userName'
},
I took your code and pasted to the MyContoller.js which is in the controller directory
Code:
refs : [
{
ref : 'editForm',
selector : 'myapp.view.MyView'
},
],
And paste it in a function:
Code:
var me = this,
editForm = me.getEditForm(),
field = editForm.down('#userName'); // itemId
field.setValue('Test');
When I run it. It says that the something is undefind.