Jump to dashboard should allow making row labels links
Currently, there are two options for the drillToDashboardNavigateTypePivot parameter in the Jump to Dashboard plugin.
1 - Allows end users to right click row/column labels to drill
2 - Turns Value cells into Hyperlinks
I propose adding an option to turn row labels into hyperlinks. I think this provides a better visual cue to end users that they can drill in.
-
Hi,
Please use this to make Row Label Hyperlink,
widget.on('ready', function(se, ev){
/*** USER CONFIGURATION ***/
var columnToMakeUrls = 2; // set the column to make linkable (index starts at 0)
var removeLinkDecoration = false; // remove the link underline
/******* *******/
var e = element;
var rows = $('tbody tr', e); // get all rows without headers
var cells = $('td[fidx='+columnToMakeUrls+']', rows); //get all the cells of the column
if(cells.length > 0){
var linkElement; //inner element that responsible for the text usually div or span
var link; // the link url
var htmlLink; //the link html element
// if its a member then we need to change the inner span
if(cells.eq(0).hasClass('p-dim-member')){
_.each(cells, function(cell){
createLinkHTML(cell, 'span');
})
}
//otherwise if its a value we need to change inner div
else if(cells.eq(0).hasClass('p-value')){
_.each(cells, function(cell){
createLinkHTML(cell, 'div');
})
}
}
else{
console.log('Cells were not found');
}
// create html link tag according to the cell and tag
function createLinkHTML(cell, tag){
var linkElement = $(tag, cell);
var link = linkElement.text();
var htmlLink = '<a href="<fixed url>'+link+'" target="_blank">' + link +'</a>'
if(removeLinkDecoration){
htmlLink = $(htmlLink).css('textDecoration','none').prop('outerHTML');
}
linkElement.html(htmlLink)
}
})
Thanks,
Pathfider(Data Science Team) -
How can I make htmlLink to point to _drill_dashboard so this can be used in conjunction with JTD? In essence, I want to set drillToDashboardNavigateTypePivot=1 so the pivot table is not directly clickable, and set the columnToMakeUrls column to point to the _drill_dashboard (for users to click on).
-
Hi Huan,
To clarify what you are looking for, are you trying to make the the columns clickable without the values being clickable? Something like in the screenshot below?
If you wanted to preserve the functionality of opening a dashboard passing the column value in as a filter, you'd need to make some modifications to the JumpToDashboard plugin code.
Or you could think about going down the path of creating a widget script based on content from these two articles:
Formatting Pivot Header Rows And Columns Via CSS
HTML Wrapper For Passing Dashboard Filters As URL ParametersHope this helps as a starting point. If you wanted this to be built on top of the JumpToDashboard plugin and be supported by Sisense, please reach out to your Customer Success Manager to discuss the possibility of a Professional Services engagement.
Good Luck!
Katie Garrison | Technical Solutions Consultant
Please sign in to leave a comment.
Comments
5 comments