<html>
<head>
<script>
require(["dojo/ready"],function(ready){
function init(dataItem) {
alert("inside init method")
updateData(dataItem);
}
function updateData(dataItem){
//inside this function, i am creating some breadcrumb and making each part of it a link.
//Now that link is calling another method outerFunction()
}
ready(function(){
init({
type: "All Locations",
id: "All_Locations"
});
});
});
function outerFunction(jsonObj){
init(jsonObj); // not working
}
</script>
</head>
<body>
<div>
</div>
</body>
</html>
So basically i need to call init()
from outerFunction()
.
Please help me in this.
I need to call init()
defined above , from outerFunction()
.
But this is not happening.
Initially i tried to keep this outerFunction()
inside require block.
But then in that case, outerFunction()
was not getting called from breadcrumb link.
So i had to move it outside. And now from outside, outerFunction()
is getting called but init()
is not getting called from outerFunction()
Or if in any way I can write outerFunction method inside require block and can make same call flow.
Solution: I have used dojo.subscribe() inside ready and dojo.publish() in outerFunction(). And it worked for me.