08-17-2015 05:17 AM
This ought to be very simple but I can't find an example of how its done.
How would I attach a topology view to a DOM element other than the default 'body' element?
Eg - I have a <div> in my page somewhere and I want the topology to appear within that DIV, not attached directly to 'body'.
thanks.
Solved! Go to Solution.
09-04-2015 01:54 PM
you can also use this way, this is easier.
var app = new nx.ui.Application();
app.container(document.getElementById('app'));
topo.attach(app);
08-17-2015 09:24 PM
I found the answer to this eventually.
The 'GetContainer' method should be used to attach the application element as a child of a DOM element -
var Shell = nx.define(nx.ui.Application, {
methods: {
start: function () {
var mv = new com.cisco.MainView();
mv.attach(this);
},
getContainer: function () {
return new nx.dom.Element(element);
},
}
});
09-04-2015 01:54 PM
you can also use this way, this is easier.
var app = new nx.ui.Application();
app.container(document.getElementById('app'));
topo.attach(app);
09-06-2015 10:08 PM
thats makes more sense - setting the container property rather than overriding the getcontainer method. I missed that. thanks!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide