<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to insert checkboxes in a simple statistics results table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-insert-checkboxes-in-a-simple-statistics-results-table/m-p/309263#M92764</link>
    <description>&lt;P&gt;Hey have a look at this&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/433204/how-to-create-a-table-with-checkboxes-in-my-html-d.html"&gt;https://answers.splunk.com/answers/433204/how-to-create-a-table-with-checkboxes-in-my-html-d.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Let me know if this helps!&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jan 2018 14:52:44 GMT</pubDate>
    <dc:creator>mayurr98</dc:creator>
    <dc:date>2018-01-17T14:52:44Z</dc:date>
    <item>
      <title>How to insert checkboxes in a simple statistics results table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-insert-checkboxes-in-a-simple-statistics-results-table/m-p/309261#M92762</link>
      <description>&lt;P&gt;Hello Splunkers,&lt;/P&gt;

&lt;P&gt;I have a situation where I have to replace the first cell in each row in a statistics table with a checkbox.&lt;/P&gt;

&lt;P&gt;example query: index=_internal | dedup sourcetype | head 5 | eval select="select" | table select, sourcetype, source, index&lt;/P&gt;

&lt;P&gt;The first cell in each row except heading should now be having a select button.&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 14:31:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-insert-checkboxes-in-a-simple-statistics-results-table/m-p/309261#M92762</guid>
      <dc:creator>allan_newton</dc:creator>
      <dc:date>2018-01-17T14:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert checkboxes in a simple statistics results table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-insert-checkboxes-in-a-simple-statistics-results-table/m-p/309262#M92763</link>
      <description>&lt;P&gt;Hi @allan_newton&lt;BR /&gt;
please refer &lt;A href="https://answers.splunk.com/answers/587089/multiselect-table-rows.html"&gt;https://answers.splunk.com/answers/587089/multiselect-table-rows.html&lt;/A&gt;&lt;BR /&gt;
here you need to include js and css to include checkbox in each row which will store field key value once it is checked in checkmark.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 14:43:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-insert-checkboxes-in-a-simple-statistics-results-table/m-p/309262#M92763</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-01-17T14:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert checkboxes in a simple statistics results table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-insert-checkboxes-in-a-simple-statistics-results-table/m-p/309263#M92764</link>
      <description>&lt;P&gt;Hey have a look at this&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/433204/how-to-create-a-table-with-checkboxes-in-my-html-d.html"&gt;https://answers.splunk.com/answers/433204/how-to-create-a-table-with-checkboxes-in-my-html-d.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Let me know if this helps!&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 14:52:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-insert-checkboxes-in-a-simple-statistics-results-table/m-p/309263#M92764</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-01-17T14:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert checkboxes in a simple statistics results table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-insert-checkboxes-in-a-simple-statistics-results-table/m-p/309264#M92765</link>
      <description>&lt;P&gt;Use TableView.BaseCellRenderer to define your own string renderer. Example: &lt;A href="http://dev.splunk.com/view/webframework-developapps/SP-CAAAEUB"&gt;http://dev.splunk.com/view/webframework-developapps/SP-CAAAEUB&lt;/A&gt;.&lt;BR /&gt;
And create css style for checkbox&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 15:23:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-insert-checkboxes-in-a-simple-statistics-results-table/m-p/309264#M92765</guid>
      <dc:creator>MelnikovTimofey</dc:creator>
      <dc:date>2018-01-17T15:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert checkboxes in a simple statistics results table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-insert-checkboxes-in-a-simple-statistics-results-table/m-p/309265#M92766</link>
      <description>&lt;P&gt;Hi @allan_newton,&lt;/P&gt;

&lt;P&gt;I have created sample dashboard for you.&lt;/P&gt;

&lt;P&gt;Can you please try below code?&lt;/P&gt;

&lt;P&gt;mydashboard.xml&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form script="my.js" stylesheet="my.css"&amp;gt;
   &amp;lt;row&amp;gt;
     &amp;lt;panel&amp;gt;
       &amp;lt;table id="myTable"&amp;gt;
         &amp;lt;title&amp;gt;My Table&amp;lt;/title&amp;gt;
         &amp;lt;search&amp;gt;
           &amp;lt;query&amp;gt;index=_internal | stats count by sourcetype | eval checkbox=sourcetype&amp;lt;/query&amp;gt;
           &amp;lt;earliest&amp;gt;-15m&amp;lt;/earliest&amp;gt;
           &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
         &amp;lt;/search&amp;gt;
         &amp;lt;option name="count"&amp;gt;10&amp;lt;/option&amp;gt;
         &amp;lt;option name="drilldown"&amp;gt;row&amp;lt;/option&amp;gt;
         &amp;lt;drilldown&amp;gt;
           &amp;lt;condition field="*"&amp;gt;

           &amp;lt;/condition&amp;gt;
           &amp;lt;/drilldown&amp;gt;
       &amp;lt;/table&amp;gt;
     &amp;lt;/panel&amp;gt;
   &amp;lt;/row&amp;gt;
   &amp;lt;row&amp;gt;
     &amp;lt;html&amp;gt;
       &amp;lt;div&amp;gt;
         &amp;lt;input type="button" id="mybutton" value="My Button" /&amp;gt;
       &amp;lt;/div&amp;gt;
     &amp;lt;/html&amp;gt;
   &amp;lt;/row&amp;gt;
   &amp;lt;row&amp;gt;
      &amp;lt;panel&amp;gt;
       &amp;lt;table&amp;gt;
         &amp;lt;title&amp;gt;My Selected Value&amp;lt;/title&amp;gt;
         &amp;lt;search&amp;gt;
           &amp;lt;query&amp;gt;| makeresults | eval myvalue="$mytoken$" | makemv delim="," myvalue | stats count by myvalue | table myvalue&amp;lt;/query&amp;gt;
           &amp;lt;earliest&amp;gt;-15m&amp;lt;/earliest&amp;gt;
           &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
         &amp;lt;/search&amp;gt;
         &amp;lt;option name="count"&amp;gt;10&amp;lt;/option&amp;gt;
         &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
       &amp;lt;/table&amp;gt;
     &amp;lt;/panel&amp;gt;
   &amp;lt;/row&amp;gt;
 &amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;my.js&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require([
     'underscore',
     'jquery',
     'splunkjs/mvc',
     'splunkjs/mvc/tableview',
     'splunkjs/mvc/simplexml/ready!'
 ], function(_, $, mvc, TableView) {
     // Access the "default" token model
     var tokens = mvc.Components.get("default");
     var selected_values_array = [];
     var submittedTokens = mvc.Components.get('submitted');

     var CustomRangeRenderer = TableView.BaseCellRenderer.extend({
         canRender: function(cell) {
             return _(['checkbox']).contains(cell.field);
         },
         render: function($td, cell) {
             var a = $('&amp;lt;div&amp;gt;').attr({"id":"chk-sourcetype"+cell.value,"value":cell.value}).addClass('checkbox').click(function() {
                 // console.log("checked",$(this).attr('class'));
                 // console.log("checked",$(this).attr('value'));
                 if($(this).attr('class')==="checkbox")
                 {
                     selected_values_array.push($(this).attr('value'));
                     $(this).removeClass();
                     $(this).addClass("checkbox checked");
                 }
                 else {
                     $(this).removeClass();
                     $(this).addClass("checkbox");
                     var i = selected_values_array.indexOf($(this).attr('value'));
                     if(i != -1) {
                         selected_values_array.splice(i, 1);
                     }
                     // Change the value of a token $mytoken$
                 }
                 console.log(selected_values_array);
             }).appendTo($td);
         }
     });

     //List of table IDs
     var tableIDs = ["myTable"];
     for (i=0;i&amp;lt;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();
             });
         }
     }
     $(document).ready(function () {
         $("#mybutton").on("click", function (e) {
             e.preventDefault();
             console.log("in");
             tokens.set("mytoken", selected_values_array.join());
             submittedTokens.set(tokens.toJSON());
         });
     });
 });
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;my.css&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/* The standalone checkbox square*/
 .checkbox {
   width:20px;
   height:20px;
   border: 1px solid #000;
   display: inline-block;
 }

 /* This is what simulates a checkmark icon */
 .checkbox.checked:after {
   content: '';
   display: block;
   width: 4px;
   height: 7px;

   /* "Center" the checkmark */
   position:relative;
   top:4px;
   left:7px;

   border: solid #000;
   border-width: 0 2px 2px 0;
   transform: rotate(45deg);
 }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here I have created javascript and Css (my.js and my.css). &lt;BR /&gt;
Keep both file in SPLUNK_HOME/etc/apps/MYAPP/appserver/static/ path.&lt;/P&gt;

&lt;P&gt;There are two tables in dashboard. First for selection and seconf for selected value.&lt;BR /&gt;
I have stored value in javascript variable &lt;CODE&gt;selected_values_array&lt;/CODE&gt; and splunk token &lt;CODE&gt;mytoken&lt;/CODE&gt;.&lt;BR /&gt;
You can use splunk token &lt;CODE&gt;mytoken&lt;/CODE&gt; in any search. &lt;BR /&gt;
2nd table is an example of using splunk token &lt;CODE&gt;mytoken&lt;/CODE&gt;. You can use this token for store in lookup.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 17:41:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-insert-checkboxes-in-a-simple-statistics-results-table/m-p/309265#M92766</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-01-18T17:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert checkboxes in a simple statistics results table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-insert-checkboxes-in-a-simple-statistics-results-table/m-p/309266#M92767</link>
      <description>&lt;P&gt;@kamlesh_vaghela any thoughts on how this could be implemented to select all the fields in a table row? EG - Table 1 has - field1 field2 field3 and the Select box, when I tick that row for selection -&amp;gt; field1 field2 field3 get sent to table 2 on a single row--essentially i want it to select the whole row with values and any sparklines i have embedded in the table row and send it to another table.&lt;/P&gt;

&lt;P&gt;Right now it looks like it only does it by a single defined value of whatever you set the eval to.. Would it be best to just make the eval = all the fields in the row?&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 14:31:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-insert-checkboxes-in-a-simple-statistics-results-table/m-p/309266#M92767</guid>
      <dc:creator>mwdbhyat</dc:creator>
      <dc:date>2019-05-16T14:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert checkboxes in a simple statistics results table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-insert-checkboxes-in-a-simple-statistics-results-table/m-p/567732#M197864</link>
      <description>&lt;P&gt;The solution provided by&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&amp;nbsp;works great.&lt;/P&gt;&lt;P&gt;How can I add 3 more columns with checkboxes? Something like this:&lt;/P&gt;&lt;TABLE width="613"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="203.455px" height="24px"&gt;&lt;STRONG&gt;sourcetype&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="44.3036px" height="24px"&gt;&lt;STRONG&gt;host&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="74.8571px" height="24px"&gt;&lt;STRONG&gt;index&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="150.813px" height="24px"&gt;&lt;STRONG&gt;sourcetype_check&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="99.1964px" height="24px"&gt;&lt;STRONG&gt;host_check&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="106.75px" height="24px"&gt;&lt;STRONG&gt;index_check&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="203.455px" height="24px"&gt;splunk_web_access&lt;/TD&gt;&lt;TD width="44.3036px" height="24px"&gt;sh1&lt;/TD&gt;&lt;TD width="74.8571px" height="24px"&gt;_internal&lt;/TD&gt;&lt;TD width="150.813px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="99.1964px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="106.75px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="203.455px" height="24px"&gt;splunk_web_service&lt;/TD&gt;&lt;TD width="44.3036px" height="24px"&gt;sh1&lt;/TD&gt;&lt;TD width="74.8571px" height="24px"&gt;_internal&lt;/TD&gt;&lt;TD width="150.813px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="99.1964px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="106.75px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="203.455px" height="24px"&gt;splunkd&lt;/TD&gt;&lt;TD width="44.3036px" height="24px"&gt;idx1&lt;/TD&gt;&lt;TD width="74.8571px" height="24px"&gt;_internal&lt;/TD&gt;&lt;TD width="150.813px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="99.1964px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="106.75px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="203.455px" height="24px"&gt;splunkd&lt;/TD&gt;&lt;TD width="44.3036px" height="24px"&gt;sh1&lt;/TD&gt;&lt;TD width="74.8571px" height="24px"&gt;_internal&lt;/TD&gt;&lt;TD width="150.813px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="99.1964px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="106.75px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="203.455px" height="24px"&gt;splunkd_access&lt;/TD&gt;&lt;TD width="44.3036px" height="24px"&gt;idx1&lt;/TD&gt;&lt;TD width="74.8571px" height="24px"&gt;_internal&lt;/TD&gt;&lt;TD width="150.813px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="99.1964px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="106.75px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="203.455px" height="24px"&gt;splunkd_access&lt;/TD&gt;&lt;TD width="44.3036px" height="24px"&gt;sh1&lt;/TD&gt;&lt;TD width="74.8571px" height="24px"&gt;_internal&lt;/TD&gt;&lt;TD width="150.813px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="99.1964px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="106.75px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="203.455px" height="24px"&gt;splunkd_remote_searches&lt;/TD&gt;&lt;TD width="44.3036px" height="24px"&gt;idx1&lt;/TD&gt;&lt;TD width="74.8571px" height="24px"&gt;_internal&lt;/TD&gt;&lt;TD width="150.813px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="99.1964px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="106.75px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="203.455px" height="24px"&gt;splunkd_ui_access&lt;/TD&gt;&lt;TD width="44.3036px" height="24px"&gt;sh1&lt;/TD&gt;&lt;TD width="74.8571px" height="24px"&gt;_internal&lt;/TD&gt;&lt;TD width="150.813px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="99.1964px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="106.75px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 18:01:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-insert-checkboxes-in-a-simple-statistics-results-table/m-p/567732#M197864</guid>
      <dc:creator>michael_vi</dc:creator>
      <dc:date>2021-09-20T18:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert checkboxes in a simple statistics results table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-insert-checkboxes-in-a-simple-statistics-results-table/m-p/568487#M198121</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231633"&gt;@michael_vi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please try this?&lt;/P&gt;&lt;P&gt;JS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; require([
    'underscore',
    'jquery',
    'splunkjs/mvc',
    'splunkjs/mvc/tableview',
    'splunkjs/mvc/simplexml/ready!'
], function(_, $, mvc, TableView) {
    // Access the "default" token model
    var tokens = mvc.Components.get("default");
    var selected_values_array = [];
    var selected_values_array_host = [];
    var selected_values_array_index = [];
    var submittedTokens = mvc.Components.get('submitted');
    console.log("This is Multi-select table JS");
    // Custom renderer for applying checkbox.
    var CustomRenderer = TableView.BaseCellRenderer.extend({
        canRender: function(cell) {
            return _(['Select Sourcetype', 'Select host', 'Select index']).contains(cell.field);
        },
        render: function($td, cell) {
            console.log(cell)
            var a = $('&amp;lt;div&amp;gt;').attr({
                "id": "chk-sourcetype" + cell.value,
                "value": cell.value
            }).addClass('checkbox').click(function() {
                if ($(this).attr('class') === "checkbox") {
                    if (cell.field === 'Select Sourcetype') {
                        selected_values_array.push($(this).attr('value'));
                    } else if (cell.field === 'Select host') {
                        selected_values_array_host.push($(this).attr('value'));
                    } else if (cell.field === 'Select index') {
                        selected_values_array_index.push($(this).attr('value'));
                    }
                    $(this).removeClass();
                    $(this).addClass("checkbox checked");
                } else {
                    $(this).removeClass();
                    $(this).addClass("checkbox");
                    if (cell.field === 'Select Sourcetype') {
                        var i = selected_values_array.indexOf($(this).attr('value'));
                        if (i != -1) {
                            selected_values_array.splice(i, 1);
                        }
                    } else if (cell.field === 'Select host') {
                        var i = selected_values_array_host.indexOf($(this).attr('value'));
                        if (i != -1) {
                            selected_values_array_host.splice(i, 1);
                        }
                    } else if (cell.field === 'Select index') {
                        var i = selected_values_array_index.indexOf($(this).attr('value'));
                        if (i != -1) {
                            selected_values_array_index.splice(i, 1);
                        }
                    }
                }
                console.log("selected_values_array", selected_values_array);
                console.log("selected_values_array_host", selected_values_array_host);
                console.log("selected_values_array_index", selected_values_array_index);
            }).appendTo($td);
        }
    });

    //List of table ID
    var sh = mvc.Components.get("myTable");
    if (typeof(sh) != "undefined") {
        sh.getVisualization(function(tableView) {
            // Add custom cell renderer and force re-render
            tableView.table.addCellRenderer(new CustomRenderer());
            tableView.table.render();
        });
    }

    // Disabling button while search is running
    var mysearch = mvc.Components.get('mysearch');
    mysearch.on('search:start', function(properties) {
        $("#mybutton").attr('disabled', true);
    });

    mysearch.on('search:done', function(properties) {
        $("#mybutton").attr('disabled', false);
    });

    var mysearch_host = mvc.Components.get('mysearch_host');
    mysearch_host.on('search:start', function(properties) {
        $("#mybutton").attr('disabled', true);
    });

    mysearch_host.on('search:done', function(properties) {
        $("#mybutton").attr('disabled', false);
    });

    var mysearch_index = mvc.Components.get('mysearch_index');
    mysearch_index.on('search:start', function(properties) {
        $("#mybutton").attr('disabled', true);
    });

    mysearch_index.on('search:done', function(properties) {
        $("#mybutton").attr('disabled', false);
    });
    $(document).ready(function() {

        //setting up tokens with selected value.
        $("#mybutton").on("click", function(e) {
            e.preventDefault();
            tokens.set("mytoken", selected_values_array.join());
            tokens.set("mytoken_host", selected_values_array_host.join());
            tokens.set("mytoken_index", selected_values_array_index.join());
            submittedTokens.set(tokens.toJSON());
            $("#mybutton").attr('disabled', true);
        });
    });
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;css&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="css"&gt;/* The standalone checkbox square*/

.checkbox {
    width: 20px;
    height: 20px;
    border: 1px solid #000;
    display: inline-block;
}


/* This is what simulates a checkmark icon */

.checkbox.checked:after {
    content: '';
    display: block;
    width: 4px;
    height: 7px;
    /* "Center" the checkmark */
    position: relative;
    top: 4px;
    left: 7px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;XML&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;dashboard script="a.js" stylesheet="a.css"&amp;gt;
  &amp;lt;label&amp;gt;Multi-Select Table Rows Example&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;!-- This Panel is for instruction purpose only--&amp;gt;
      &amp;lt;html&amp;gt;
    &amp;lt;h1&amp;gt;This is an example for multi select table rows.&amp;lt;/h1&amp;gt;
    &amp;lt;h2&amp;gt;Steps:&amp;lt;/h2&amp;gt;
    &amp;lt;ui&amp;gt;
    &amp;lt;li&amp;gt;Select rows from Panel A by clicking on checkboxes.&amp;lt;/li&amp;gt;
    &amp;lt;li&amp;gt;Click on "Submit" button&amp;lt;/li&amp;gt;
    &amp;lt;li&amp;gt;You will get selected values in Panel B.&amp;lt;/li&amp;gt;
    &amp;lt;/ui&amp;gt;
    &amp;lt;br/&amp;gt;
    &amp;lt;h3&amp;gt;This is how you can achieve your requirements. See below files for implementation code.&amp;lt;/h3&amp;gt;
    &amp;lt;code&amp;gt;multiselect_table.js&amp;lt;/code&amp;gt;
        &amp;lt;br/&amp;gt;
    &amp;lt;code&amp;gt;multiselect_table.css&amp;lt;/code&amp;gt;
        &amp;lt;br/&amp;gt;
    &amp;lt;code&amp;gt;multiselect_table.xml&amp;lt;/code&amp;gt;
        &amp;lt;br/&amp;gt;
    &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table id="myTable"&amp;gt;
        &amp;lt;title&amp;gt;Panel A&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal | stats count by sourcetype | eval "Select Sourcetype"=sourcetype | table "Select Sourcetype" sourcetype count | eval host=sourcetype,index=sourcetype,"Select host"=host,"Select index"=index | table  sourcetype host index "Select Sourcetype" "Select host" "Select index"&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-15m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;10&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;row&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
        &amp;lt;drilldown&amp;gt;
          &amp;lt;condition field="*"&amp;gt;&amp;lt;/condition&amp;gt;
        &amp;lt;/drilldown&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
       &amp;lt;div&amp;gt;
         &amp;lt;input type="button" id="mybutton" value="Submit"/&amp;gt;
       &amp;lt;/div&amp;gt;
     &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;title&amp;gt;Panel B&amp;lt;/title&amp;gt;
        &amp;lt;search id="mysearch"&amp;gt;
          &amp;lt;query&amp;gt;| makeresults | eval SelectedRowValue="$mytoken$" | makemv delim="," SelectedRowValue | stats count by SelectedRowValue | table SelectedRowValue&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-15m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;10&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;title&amp;gt;Panel B&amp;lt;/title&amp;gt;
        &amp;lt;search id="mysearch_host"&amp;gt;
          &amp;lt;query&amp;gt;| makeresults | eval SelectedRowValue="$mytoken_host$" | makemv delim="," SelectedRowValue | stats count by SelectedRowValue | table SelectedRowValue&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-15m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;10&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;title&amp;gt;Panel B&amp;lt;/title&amp;gt;
        &amp;lt;search id="mysearch_index"&amp;gt;
          &amp;lt;query&amp;gt;| makeresults | eval SelectedRowValue="$mytoken_index$" | makemv delim="," SelectedRowValue | stats count by SelectedRowValue | table SelectedRowValue&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-15m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;10&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;▄︻̷̿┻̿═━一 &amp;nbsp; &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Sep 2021 17:40:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-insert-checkboxes-in-a-simple-statistics-results-table/m-p/568487#M198121</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-09-26T17:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert checkboxes in a simple statistics results table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-insert-checkboxes-in-a-simple-statistics-results-table/m-p/573275#M199795</link>
      <description>&lt;P&gt;Is there a way to "keep the checkbox"?&lt;BR /&gt;Once you browse between the pages, the checkbox disappears.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2021 08:57:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-insert-checkboxes-in-a-simple-statistics-results-table/m-p/573275#M199795</guid>
      <dc:creator>michael_vi</dc:creator>
      <dc:date>2021-11-02T08:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert checkboxes in a simple statistics results table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-insert-checkboxes-in-a-simple-statistics-results-table/m-p/612878#M213056</link>
      <description>&lt;P&gt;when i select 2 rows in first page then i go to second page &amp;amp;checked other row and i am back to first page,. now in first page i am not able to see my selected check boxes in first page.&lt;/P&gt;&lt;P&gt;can you please help me&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 12:20:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-insert-checkboxes-in-a-simple-statistics-results-table/m-p/612878#M213056</guid>
      <dc:creator>ajayabburi508</dc:creator>
      <dc:date>2022-09-13T12:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert checkboxes in a simple statistics results table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-insert-checkboxes-in-a-simple-statistics-results-table/m-p/613379#M213175</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/198976"&gt;@ajayabburi508&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please replace the below code in JS?&lt;/P&gt;&lt;P&gt;Old:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var a = $('&amp;lt;div&amp;gt;').attr({"id":"chk-sourcetype"+cell.value,"value":cell.value}).addClass(checkbox_css).click(function() {&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;New:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var checkbox_css = selected_values_array.includes(cell.value) ? "checkbox checked" : "checkbox";
            var a = $('&amp;lt;div&amp;gt;').attr({"id":"chk-sourcetype"+cell.value,"value":cell.value}).addClass(checkbox_css).click(function() {&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;If any of my replies help you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 11:35:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-insert-checkboxes-in-a-simple-statistics-results-table/m-p/613379#M213175</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2022-09-16T11:35:03Z</dc:date>
    </item>
  </channel>
</rss>

