Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

VizLib advanced text object and my own extension navigate to links even in edit mode

I have a KPI extension, that basically has a "go to sheet" when you click it, ... it works but also works in editor mode. I found a similar thing happening with the VIzLib advanced text object. If you add an action of a sheet, and left-click the object in edit mode it will jump to the sheet where the link points.

I have a workaround to right-click my objects that have links , but this isn't very ideal.

I've taken some code from an extension that is supposed to only cause a link "goto" to navigate when in analysis mode, i.e. not in "EDIT" mode based on the qlik.navigation.getMode()

    extensionUtils.addStyleToHeader(cssContent, "swr-themablekpitile");

    var layouts = JSON.parse(layoutsText);

    return {

   paint: function(element, layout) {


var result = qlik.navigation.getMode();

if(result == 'analysis'){

console.log('ANALYSIS');

$('.goto').click(function() {

console.log('click');

qlik.navigation.gotoSheet($(this).attr('id'));

                });

};

   },

        initialProperties: {

            showTitles: !1

        },

initially the link is set like this

<a class="goto" id="{{ layout.gotosheet }}" href="javascript:;" style="text-decoration:none">

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

the goto function itself needs to check the qlik's navigation mode is not edit.

otherwise what was happening is the mode isn't analysis its edit, but the buttons function is likely already set from previous paint call to navigate to the sheet.

This revised code here will hopefully help prevent some annoyances and lag from having to right click on the objects instead of left-click.

  paint: function(element, layout) {

var result = qlik.navigation.getMode();

if(result == qlik.navigation.ANALYSIS){

$('.goto').click(function() {

if(qlik.navigation.getMode()!='edit'){

qlik.navigation.gotoSheet($(this).attr('id'));

}

                });

};

  },

View solution in original post

1 Reply
Anonymous
Not applicable
Author

the goto function itself needs to check the qlik's navigation mode is not edit.

otherwise what was happening is the mode isn't analysis its edit, but the buttons function is likely already set from previous paint call to navigate to the sheet.

This revised code here will hopefully help prevent some annoyances and lag from having to right click on the objects instead of left-click.

  paint: function(element, layout) {

var result = qlik.navigation.getMode();

if(result == qlik.navigation.ANALYSIS){

$('.goto').click(function() {

if(qlik.navigation.getMode()!='edit'){

qlik.navigation.gotoSheet($(this).attr('id'));

}

                });

};

  },