javascript - Render Extjs elements into other frame -
i want render ext elements in iframe.
in page loaded iframe, have div element:
<div id="panel"></div>
when iframe loaded, want render ext panel div element.
so page loaded iframe got function executed on load:
console.log(parent.ext.get("panel")); console.log(document.getelementbyid("panel")); console.log(new parent.ext.dom.element(document.getelementbyid("panel"))); parent.ext.create('ext.panel',{ layout : 'fit', height : 200, width : 600, autoscroll: false, renderto : new parent.ext.dom.element(document.getelementbyid("panel")) });
the console messages follows:
null vm14143:10 <div id="panel">…</div> vm14143:11 d {el: d, dom: div#panel, id: "panel", $cache: object, self: function…} vm14143:12 typeerror: cannot read property 'dom' of null
the typeerror occuring no matter of 3 console.logs put renderto: renderto: parent.ext.get("panel")
or renderto: document.getelementbyid("panel")
or renderto: new parent.ext.dom.element(document.getelementbyid("panel"))
, not occur when remove renderto
line completely.
now, how can render panel div?
what trying wrong. because when parent.ext, execute in parent scope in current scope(which iframe) need is, have extjs library loaded in iframe well, , execute code.
Comments
Post a Comment