I have four files:
layout.html //contains ext resources
layout.js //contains my panel
partial.html //contains <script src="partial.js">
partial.js //contains a component
I have this panel configured in my layout.js:
var myPanel = Ext.widget('panel',{
title: 'Load HTML into panel',
html: 'initial',
width: 300,
height: 300,
loader: {
url: 'partial.html',
renderer: 'html',
scripts: true,
autoLoad: true
},
renderTo: Ext.getBody()
});
And this code in my partial.js
Ext.onReady(function(){
var myDynPanel = Ext.widget('panel',{
title: 'Is this working',
html: 'Dynamic test',
//renderTo: 'myDynPnl'
});
});
I want to render myDynPanel inside my myPanel. I am aware that the renderer
config on the loader can be set to component, but I'm working with C#.NET MVC and I'm getting partial views results as HTML.
My solution now is create a <div id="myDynPnl"></div>
inside partial.html and render the dynamic panel to the div. But I don't want to use id in my page.
What is the best way to accomplish this. Thanks in advance.
using: ExtJS 4.1.2
After a month we created a solution :).
Have a question? Ask it!
PartialViewLoader.js
Index.js
Index.cshtml
Js File