Hello Everyone, Thanks in advance! I have created a table view with select input Yes/No as Decision column, I am able to render the selected Yes/No in the view, but need to record the selection made to in the view to the lookup I have created below view for reference. Below is my XML code <dashboard version="1.1" script="table_select.js" hideEdit="false" hideChrome="true">
<label>Checklist</label>
<row>
<panel>
<table id="base_table">
<search id="bestMain">
<query>| makeresults count=10
| fields - _time
| streamstats c as SRNo
| eval Task="Task"." ".'SRNo'
| eval Decision=""
| fields SRNo Task Decision</query>
<earliest>0</earliest>
<latest>now</latest>
<sampleRatio>1</sampleRatio>
</search>
<option name="count">50</option>
<option name="dataOverlayMode">none</option>
<option name="drilldown">none</option>
<option name="percentagesRow">false</option>
<option name="refresh.display">progressbar</option>
<option name="rowNumbers">false</option>
<option name="totalsRow">false</option>
<option name="wrap">true</option>
</table>
</panel>
</row>
</dashboard> JS used for the view. require([
'underscore',
'jquery',
'splunkjs/mvc',
'splunkjs/mvc/tableview',
'splunkjs/mvc/simplexml/ready!'
], function(_, $, mvc, TableView) {
var CustomRangeRenderer = TableView.BaseCellRenderer.extend({
canRender: function(cell) {
return _(['Decision']).contains(cell.field);
},
render: function($td, cell)
{
$td.html("<div ><select name='decision' id='cars'> <option value='No'>Select</option><option value='No'>No</option> <option value='Yes'>Yes</option></select> </div>")
}
});
//List of table IDs to add icon
var tableIDs = ["base_table"];
for (i=0;i<tableIDs.length;i++) {
var sh = mvc.Components.get(tableIDs[i]);
if(typeof(sh)!="undefined") {
sh.getVisualization(function(tableView) {
// Add custom cell renderer and force re-render
tableView.table.addCellRenderer(new CustomRangeRenderer());
tableView.table.render();
});
}
}
});
... View more