04-01-2015 03:47 AM
Hi,
We have integrated next topology in Prime UI WAP3.1.
We have a requirement where, we can remember the placement of icons displayed even if we move from one page to another.
For now, we are calling API which returns us the x,y co-ordinates of the icons and this API gets called each time we visit the page. So it displays the icons at pre-defined positions.
Do we have any solution to remember the position of icons?
Thanks,
Sachin
04-09-2015 01:59 PM
Hi Sachin,
You can call topo.getData() get the all data from topology and try to save back-end or localstorage. next you visit you can loadd that that and call topo.setData().
Abu
10-09-2015 12:17 AM
hy Abu
It's sounds easy... but I didn't get it. Can you show us an example?
thanks
Thiago
10-11-2015 03:16 AM
Hi,
I found a way how to do (maybe not the best, but it works for me):
1) declare variable "node" your nx.ui.Application as global:
var App = nx.define(nx.ui.Application, {
methods: {
start: function() {
node = new MyName.Node();
node.attach(this);
}
}
});
2) In your class extending nx.ui.Component define a methode getTopo:
methods: {
attach: function(args) {
this.inherited(args);
this.model(mainModel);
},
getTopo: function() {
var i = this._resources.topo;
return i;
}
}
3) define javascript function called from save button:
<script>
function showData(){
var node = window.node;
var topo = node.getTopo();
var result = topo.getData();
.....
</script>
Result now holds TopologyData Object.
hope that helps
Markus
10-14-2015 06:28 PM
Usually we do this at back end, the topology model already have coordinate properties, if you can save this in database with back end service, then fill it back for topology model it will show memorized topology without problem!
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