我有一个 HTML 页面要在 ExtJS
的 iframe
中显示。我想为特定的 iframe
设置一个 id
,我该怎么做?
请引用下面的示例代码,我已经分配了一个sampleId
,但它根本不起作用。
Ext.application({
name: 'Fiddle',
launch: function () {
Ext.create('Ext.window.Window', {
title: 'Open other html file inside of window',
height: 500,
width: 500,
layout: 'fit',
items: [{
xtype: "component",
autoEl: {
id: "sampleId",
tag: "iframe",
src: "res/example.html"
}
}]
}).show();
}
});
最佳答案
将 id
的设置移至组件本身:
items: [{
xtype: "component",
id: 'sampleId',
autoEl: {
tag: "iframe",
src: "res/example.html"
}
}]
关于javascript - 如何在ExtJS中为Iframe设置Id?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51411978/