Last active
August 29, 2015 14:05
-
-
Save hobbes3/db65e8794c7f783b0a1b to your computer and use it in GitHub Desktop.
total results count table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require([ | |
'jquery', | |
'underscore', | |
'splunkjs/mvc', | |
'splunkjs/mvc/simplexml/ready!' | |
], | |
function( | |
$, | |
_, | |
mvc | |
) { | |
// Initially set the $ip_count$ token | |
// You don't need an input placeholder in Simple XML (like pre-6.1 in-page drilldown example) | |
mvc.Components.get('default').set('ip_count', "Waiting..."); | |
// Grab the search object from the first panel | |
// There may be a better way to get the first panel's search | |
var ip_search = mvc.Components.getInstance("search1"); | |
// When the search finishes... | |
ip_search.on('search:done', function(properties) { | |
// Get the total results | |
var ip_count = this.attributes.data.resultCount; | |
// Update the token | |
// There is no need to actually submit and update the URL since this token can always be re-calculated on every page load | |
mvc.Components.get('default').set('ip_count', ip_count); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment