我面临的问题是。我有一个查询数据库并获取汽车信息的表单,我想获得该数据的唯一ID并将其传递给已经制作的组件。
layout : 'fit',
items : [{
xtype: 'cargrid',
autoScroll: true
//here I want the ID to be passed to this cone
}]
答案 0 :(得分:0)
也许,你想在网格上显示行的ID吗?
<强> MODEL:强>
fields: [
{name: 'idRow'},
{...}
]
网格视图:
columns: [{
header: "Identificator",
dataIndex: 'idRow'
},
{...}
]
编辑:
如果您想覆盖de ID:
请参阅链接所属:itemID
并在评论中:(复制和粘贴)
示例:强>
var c = new Ext.panel.Panel({ //
height: 300,
renderTo: document.body,
layout: 'auto',
items: [
{
itemId: 'p1',
title: 'Panel 1',
height: 150
},
{
itemId: 'p2',
title: 'Panel 2',
height: 150
}
]
})
p1 = c.getComponent('p1'); // not the same as Ext.getCmp()
p2 = p1.ownerCt.getComponent('p2'); // reference via a sibling
<强>注释:强>
Ext.apply(c, {
itemId : 'p3'
}
答案 1 :(得分:0)
一旦渲染,您就无法更改组件ID。您可以在创建组件之前进行分配。
解决方法:
据我了解,its not possible to change component ID after rendering of component
。
由于