Here is the dashboard xml :
<dashboard script="home2.js">
<label>solution2</label>
<set token="remark"></set>
<row>
<panel>
<input type="dropdown" token="location" searchWhenChanged="true">
<label></label>
<default>%</default>
<choice value="%">ALL</choice>
<choice value="%Page%">Page</choice>
<choice value="%Search%">Search</choice>
</input>
<input type="radio" token="issue" searchWhenChanged="true">
<label></label>
<default>%</default>
<choice value="%">ALL</choice>
<search>
<query>| inputlookup worklog.csv | where (location LIKE "$location$") | stats count by issue</query>
</search>
<fieldForLabel>issue</fieldForLabel>
<fieldForValue>issue</fieldForValue>
</input>
<table id="table">
<search>
<query>| inputlookup worklog.csv | where (location LIKE "$location$") AND (issue LIKE "$issue$") | table solution remark</query>
<earliest>0</earliest>
<latest></latest>
</search>
<option name="wrap">true</option>
<option name="rowNumbers">false</option>
<option name="drilldown">row</option>
<option name="dataOverlayMode">none</option>
<option name="count">10</option>
<fields>solution</fields>
</table>
</panel>
<panel id="chart1">
<html>
<div>
<p id="Remark">$remark$</p>
</div>
</html>
</panel>
</row>
</dashboard>
And the js:
var deps = [
"jquery",
"splunkjs/mvc",
"splunkjs/mvc/utils",
"splunkjs/ready!",
"splunkjs/mvc/tableview",
"splunkjs/mvc/searchmanager",
"splunkjs/mvc/simplexml/ready!"
];
var db_boo = true;
var qt_boo = true;
require(deps, function($,mvc, TableView) {
var unsubmittedTokens = splunkjs.mvc.Components.getInstance("default");
var location = unsubmittedTokens.get("lotaciton");
unsubmittedTokens.set("remark",location);
mvc.Components.get('table').getVisualization(function(tableView) {
tableView.on('click', function(d) {
window.open("http://www.baidu.com");
d.preventDefault();
if(d.field=="solution"){
if(d.data["row.remark"]){
unsubmittedTokens.set("remark", d.data["row.remark"]);
} else {
unsubmittedTokens.set("remark", "");
}
};
});
});
});
... View more