I'm having trouble implementing a custom TimeRange picker using Splunk 6 & SplunkJS (splunkjs/mvc/timerangeview -- dialogOptions property). Here is an example of the template that has the issue...
...
{% block content %}
<div id="mytimerangeview" />
{% endblock content %}
{% block js %}
<script>
var deps = [
"splunkjs/ready!",
...
"splunkjs/mvc/timerangeview"
];
require(deps, function(mvc,_) {
...
var TimeRangeView = require("splunkjs/mvc/timerangeview");
var dlgopts = {
showPresets:false,
showPresetsRealTime:false,
showPresetsRealTimeOnly:false,
showPresetsRelative:false,
showPresetsAllTime:false,
showCustom:false,
showCustomRealTime:false,
showCustomRelative:false,
showCustomDate:true, // Only show CustomDate
showCustomDateTime:false,
showCustomAdvanced:false,
enableCustomAdvancedRealTime:false
};
var mytimerange = new TimeRangeView({
id: "mysearch_id",
managerid: "mysearch_mgr_id",
preset: "Yesterday",
dialogOptions: dlgopts,
el: $("#mytimerangeview")
}).render();
mytimerange.on("change", function() {
mysearch.search.set(mytimerange.val());
});
...
)};
I left out the SearchManager bits to prevent confusion. Note that everything works except the dialogOptions property. I am still seeing everything, despite trying to hide everything but the CustomDate option. I've tried following the example on Splunk's website found here:
http://docs.splunk.com/DocumentationStatic/WebFramework/1.1/compref_timerange.html
Not sure if I'm doing something wrong or if this isn't working for anyone else. I noticed that the dialogOptions property was not available in WebFramework 1.0 -- see here:
http://docs.splunk.com/DocumentationStatic/WebFramework/1.0/compref_timerange.html
I'm not sure which version Splunk 6 has "built-in" -- more importantly, does it actually support the TimeRangeView dialogOptions property. Whatever the case, I'd like to use it. Any good info on this problem would be a great help.
... View more