Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I would like to split my javascript extension into function.
Currently I have my extension defined like this:
Qva.LoadScript(template_path + 'tinydropdown.js', function () {
Qva.AddDocumentExtension('dropdownMenu', function(){
Qva.LoadCSS(template_path + "tinydropdown.css");
var _this = this;
var mydoc = Qv.GetCurrentDocument();
_this.Document.SetTabrowPaint(paintNav);
var tabrowDiv = document.getElementById("Tabrow");
tabrowDiv.removeAttribute("class");
});
});
I would like to externalize these lines into a function:
_this.Document.SetTabrowPaint(paintNav);
var tabrowDiv = document.getElementById("Tabrow");
tabrowDiv.removeAttribute("class");
I have tried but it is not working.
Could you please help me?
Thanks
Hi Alexandre,
Can you share what you did to try and do this?
It should work fine as long as you're calling it etc
Hi,
I have tried to split te function like this:
Qva.LoadScript(template_path + 'tinydropdown.js', function () {
Qva.AddDocumentExtension('dropdownMenu', function(){
//Load a CSS style sheet
Qva.LoadCSS(template_path + "tinydropdown.css");
chargemenu();
});
});
function chargemenu()
{
var _this = this;
var mydoc = Qv.GetCurrentDocument();
_this.Document.SetTabrowPaint(paintNav);
// overrule the standard QlikView tabrow style
var tabrowDiv = document.getElementById("Tabrow");
tabrowDiv.removeAttribute("class");
}