javascript - Accessing an iframe inside a tab panel extjs4.2 -


i have tab panel formed of 2 tabs. i'm trying access iframe in each tab using "window.frames["id"]" i'm getting undefined when alerting it. how access iframe in case?

 tabpanel = ext.create('ext.tab.panel', {             region: 'center',             activetab: 0,             autoscroll: true,             items: [                     {                            id:"panel_a",                         title: "${tr.a}",                         html: "<iframe src= '"+a_url +"' width='100%' height='100%' id='frm_a' name='frm_a' frameborder=0 />",                     },{                         id:"panel_b",                         title: "${tr.b}",                         //disabled:tabs_status,                         //hidden:hidden,                         html: "<iframe src='"+b_url +"'  width='100%' height='100%' id='frm_b' name='frm_b' frameborder=0 />",                     }]             });           viewport = new ext.viewport({             layout:'border',             items:[tabpanel]         }); 

to select dom elements can use ext.dom.query.select(), alias ext.query().

ext.dom.query provides high performance selector/xpath processing compiling queries reusable functions. new pseudo classes , matchers can plugged. works on html , xml documents (if content node passed in).

more navigating through dom extjs in this answer.

try ext.query('iframe#frm_a');

working fiddle


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -