- How to attach a topology view to a DOM element other than the default 'body' element.
Eg - Got a <div> in my page somewhere and would like to have the topology to appear within that DIV, not attached directly to 'body'.
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);
},
}
});
you can also use this way, this is easier.
var app = new nx.ui.Application();
app.container(document.getElementById('app'));
topo.attach(app);
setting the container property rather than overriding the getcontainer method.
Comments
0 comments
Please sign in to leave a comment.