I want to link to a pivot table from the menu in my app, so I've implemented it as described here: http://answers.splunk.com/answers/109375/datamodel-and-pivot-export-with-app.html
When I look at it in the menu, there are two parts to it, the name on the left, and an icon on the right. Each of these things is a different link: The name links to a report, while the icon links directly to the pivot table. I don't ever need a report here - I only want the pivot table link. Is there any way to make that happen?
(Also, when I look at it in my app menu, the icon is a magnifying glass, the "search" icon, but when I navigate to it from the main apps screen in 6.1.x, it has the two arrows, the "pivot table" icon. Why is that?)
I'm about 84% certain that you are stuck with this behavior, at least in terms of easily configured functionality. There may be an option to make it work if you'd like to delve into doing some CSS and/or javascript work. This page in the advanced dev manual discusses the available customization options.
I would also like for this to be easier, and I just wrote it up in our internal tracker as feature request SPL-93948.
I'm about 84% certain that you are stuck with this behavior, at least in terms of easily configured functionality. There may be an option to make it work if you'd like to delve into doing some CSS and/or javascript work. This page in the advanced dev manual discusses the available customization options.
I would also like for this to be easier, and I just wrote it up in our internal tracker as feature request SPL-93948.
The fix for simple XML is similar, except you need to create a new Javascript file in the same directory as above, change hover
to mouseover
, and wrap the Javascript blob in this wrapper:
require([
'jquery'
],function($) {
...similar Javascript goes here ...
});
And then at the top of your simple XML pages, refer to this new script:
<form script="mynew javascript.js">
EDIT: Whoops, I spoke too soon. The solution below seems to only work on advanced XML pages in my app. It does not work on the simple XML pages.
Thanks for your help. It took me a while to find starting from your link, but I figured out how to do this.
It turns out that each of these "split" links have a different class associated with them, "primary-link" and "secondary-link". I leveraged that information within a new Javascript file I created within the app, myapp\appserver\static\application.js
. I scoped the selector to just the primary link of the split items in my app's menus that have "report" in them, and assigned them the href of the secondary link (the pivot table), like so:
$(document).on("hover","a.primary-link[href*='myapp/report']",null,function() {
$(this).prop("href",$(this).parent().find("a.secondary-link").prop("href"));
});
I do hope that Splunk makes this easier in the future, but this is working for me now. Thanks for the pointer.
Can you provide an example of the nav menu XML that exhibits the above behavior?
Sure:
<saved name="Pivot Table" view="pivot" />
The saved search includes the following directives (among others):
[Pivot Table]
display.general.type = visualizations
display.page.pivot.dataModel = /servicesNS/nobody/myapp/datamodel/model/pvt
display.visualizations.show = 0
request.ui_dispatch_app = myapp
request.ui_dispatch_view = pivot
search = | pivot pvt Thing_Being_Counted count(Thing_Being_Counted) AS "Count of Thing Being Counted" ROWSUMMARY 0 COLSUMMARY 0 NUMCOLS 0 SHOWOTHER 1
displayview = pivot
Got it. Like this:
Exactly. So my question is, how do I get the "test" link on the left to go directly to the pivot table, just like the magnifying glass on the right does. Right now, when you click on "test," it goes to a static report of whatever is in the pivot table, but not the pivot table itself.
I have also tried:
display.general.type = statistics
But that has no effect.