我在ExtJS4中构建了一个主/详细表单,作为学习ExtJS的练习。
我想传下去
id
从主表到
detail
当我创建一篇新文章时。
当
create
按钮被按下
detailGrid
这个
身份证件
传递给
controller
。在
控制器
我可以看到
身份证件
通过
console.log
所以我知道它存在于
控制器
.
我如何将其传递到表单?
控制器:
{
var detailgrid = button.up('userdetail');
var parentId = detailgrid.getParentId();
console.log(parentId);
var view = Ext.widget('detailadd');
},
我需要得到的表格
parentId
来自
控制器
Ext.define('calsberg.view.user.DetailsAdd', {
extend: 'Ext.window.Window',
alias: 'widget.detailadd',
title: 'Add Artikli',
config:
{
parentId: parentId
},
layout: 'fit',
autoShow: true,
initComponent: function () {
this.items = [
{
xtype: 'form',
bodyStyle: {
background: 'none',
padding: '10px',
border: '0'
},
items: [
{
xtype: 'textfield',
name: 'parentId',
value: this.getParentId()
},
{
xtype: 'textfield',
name: 'sifra',
allowBlank: false,
fieldLabel: 'Å ifra'
},
{
xtype: 'textfield',
name: 'naziv',
allowBlank: false,
vtype: 'naziv',
fieldLabel: 'Naziv'
},