Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
in my extension I am trying to call gotoSheet() in a div.
My javascript
var link = document.createElement("div");
link.setAttribute("ng-click", "navigation.gotoSheet('" + linkitem.sheetid + "');");
var span = document.createElement("span");
span.setAttribute("class", "lui-icon lui-icon--play");
span.setAttribute("area-hidden", "true");
link.append(span);
var span1 = document.createElement("span");
span1.innerHTML = "Test";
link.append(span1);
This leads into:
<div ng-click="navigation.gotoSheet('9076ed39-9650-4d60-9298-0e466fd9bb5c');">
<span class="lui-icon lui-icon--play" area-hidden="true"></span>
<span>Test</span>
</div>
It doesn't do anything when clicking on that div.
Someone has an idea?
PS: I tried without the ' but it didn't work as well...
Thanks!
Maybe you need to prefix it with qlik so "qlik.navigation.gotoSheet(..."
The one time I did this I never used the ng-click event tho. I did it with vanilla js event listener and stored the sheet id as a data-attribute on the element.
So maybe something like:
link.setAttribute('data-sheet','YourSheetIdHere');
link.addEventListener('click',function(){
qlik.navigation.gotoSheet(this.getAttribute('data-sheet'));
});
Maybe you need to prefix it with qlik so "qlik.navigation.gotoSheet(..."
The one time I did this I never used the ng-click event tho. I did it with vanilla js event listener and stored the sheet id as a data-attribute on the element.
So maybe something like:
link.setAttribute('data-sheet','YourSheetIdHere');
link.addEventListener('click',function(){
qlik.navigation.gotoSheet(this.getAttribute('data-sheet'));
});
Man, this is perfect and works instantly!!!!
The first qlik.navigation does not work (I don't know why) - but your second hint works fine!
Thanks you so much!