<?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 have a checkbox, check all the rows in the table in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459257#M33911</link>
    <description>&lt;P&gt;@kamlesh_vaghela  one thing , I have added a filter to the form to get only some sourcetypes &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;     &amp;lt;dashboard script="multiselect_table.js" stylesheet="multiselect_table.css"&amp;gt;
        &amp;lt;label&amp;gt;Multi-Select Table Rows Example&amp;lt;/label&amp;gt;
        &amp;lt;fieldset submitButton="false" autoRun="true"&amp;gt;
         &amp;lt;input type="text" token="filter1"&amp;gt;
          &amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;
          &amp;lt;default&amp;gt;&amp;lt;/default&amp;gt;
         &amp;lt;/input&amp;gt;
        &amp;lt;/fieldset&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 id="SearchA"&amp;gt;
                &amp;lt;query&amp;gt;index=_internal |search sourcetype="%$filter1$%"| stats count by sourcetype | eval CheckBox=sourcetype | table CheckBox sourcetype count&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;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but when i select check box to check all , All soucretypes are coming as result , I want only filtered one in the result, Can pls u tell me how to do this one&lt;/P&gt;</description>
    <pubDate>Sat, 24 Aug 2019 08:04:01 GMT</pubDate>
    <dc:creator>vasanthi77</dc:creator>
    <dc:date>2019-08-24T08:04:01Z</dc:date>
    <item>
      <title>How to have a checkbox, check all the rows in the table?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459254#M33908</link>
      <description>&lt;P&gt;Hi all , &lt;BR /&gt;My requirement is to have a dashboard for bulk alarm enable /disable. means I can select multiple alarms and click a button which will disable/enable the alarms. for that to have check boxes in table i used "&lt;A href="https://answers.splunk.com/answers/587089/multiselect-table-rows.html" target="_blank" rel="noopener"&gt;https://answers.splunk.com/answers/587089/multiselect-table-rows.html&lt;/A&gt; " and created a dashboard like this&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/7556iB5A5B24016B877C1/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Now I need a checkbox which will select all other check boxes. I want to have that checkbox in table header in third column that is in place of "checkbox" in my picture. Also I would like to refresh page when submit button is clicked , so that user will understand that action completed.. Can some one please help me to achieve this.&lt;/P&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) {

    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($th, 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")
                {
                    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);
                    }

                }
                console.log(selected_values_array);
            }).appendTo($th);
        }
    });

    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() {

                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);
                    }

                }
                console.log(selected_values_array);
            }).appendTo($td);
        }
    });


    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) {

                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());
            console.log("refresh");

        });
    });
});
&lt;/CODE&gt;&lt;/PRE&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;fieldset submitButton="false" autoRun="true"&amp;gt;
    &amp;lt;input type="text" token="filter1"&amp;gt;
      &amp;lt;label&amp;gt;label&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&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 id="mysearch1"&amp;gt;
          &amp;lt;query&amp;gt;|rest /servicesNS/-/-/saved/searches |rename eai:acl.app as app|where app="asp" and title  like "%$filter1$%"|dedup title|rename disabled as Enabled|replace 0 with Yes , 1 with No in Enabled|rename title as sourcetype|table sourcetype,Enabled| 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 id="mysearch"&amp;gt;
          &amp;lt;query&amp;gt;|enablecustom enable "$mytoken$"&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;Please help me. &lt;BR /&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 04:57:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459254#M33908</guid>
      <dc:creator>vasanthi77</dc:creator>
      <dc:date>2020-07-15T04:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to have a checkbox, check all the rows in the table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459255#M33909</link>
      <description>&lt;P&gt;@vasanthi77 &lt;/P&gt;

&lt;P&gt;I did some enhancement with this code. Can you please try it?&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;multiselect_table.js&lt;/STRONG&gt;&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 isSelectAll = false;
    var searchAValues = [];
    var searchAFields = [];
    var fieldKey = "CheckBox";
    var fieldDataStoreKey="data-sort-key="+fieldKey;
    var submittedTokens = mvc.Components.get('submitted');
    console.log("This is Multi-select table JS test Kamlesh");
    // Custom renderer for applying checkbox.
    var CustomRenderer = TableView.BaseCellRenderer.extend({
            canRender: function (cell) {
                return _([fieldKey]).contains(cell.field);
            },
            render: function ($td, cell) {
                // all_values_array.push(cell.value);
                var cls = "checkbox";
                if(isSelectAll) {
                    cls = "checkbox checked";
                }
                var a = $('&amp;lt;div&amp;gt;').attr({
                    "id": "chk-sourcetype_" + cell.value,
                    "value": cell.value
                }).addClass(cls).click(function () {
                    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);
                        }
                    }
                    console.log(selected_values_array);
                }).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();
            tableView.on('rendered', function(view) {
                setCheckAllCheckBox();
            });
            // setCheckAllCheckBox();
        });
    }

    var SearchA = mvc.Components.get("SearchA");
    var SearchAResults = SearchA.data("results");
    SearchAResults.on("data", function () {
        resultArray = SearchAResults.data().rows;
        searchAFields = SearchAResults.data().fields;
        var keyIndex=searchAFields.indexOf(fieldKey);
        searchAValues = [];
        $.each(resultArray, function (index, value) { 
            searchAValues[index]=value[keyIndex];
        })
    });

    SearchA.on('search:start', function (properties) {
        console.log("kamlesh",properties);
        isSelectAll = false;
        tokens.unset("mytoken");
        tokens.set("mytoken", "");
        submittedTokens.set(tokens.toJSON());
    });
    SearchA.on('search:done', function (properties) {
        console.log("kamlesh",properties);
    });

    // Disabling button while search is running
    var SearchB = mvc.Components.get('SearchB');
    SearchB.on('search:start', function (properties) {
        $("#mybutton").attr('disabled', true);
    });

    SearchB.on('search:done', function (properties) {
        $("#mybutton").attr('disabled', false);
    });
    var sto;
    function setCheckAllCheckBox()
    {
        // console.log("In setCheckAllCheckBox");
        var a = $("["+fieldDataStoreKey+"]");
        // console.log(a);
        a.html("");
        var cls = "checkbox";
        if(isSelectAll) {
            cls = "checkbox checked";
        }
        var temp = $('&amp;lt;div&amp;gt;').attr({
            "id": "chk-sourcetype-All",
            "value": "All"
        }).addClass(cls).click(function () {
            if ($(this).attr('class') === "checkbox") {
                $(this).removeClass();
                $(this).addClass("checkbox checked");
                isSelectAll = true;
            } else {
                $(this).removeClass();
                $(this).addClass("checkbox");
                isSelectAll = false;
            }
            checkUnCheckAllCheckboxes();
        }).appendTo(a);
        $("["+fieldDataStoreKey+"]").parent().removeAttr("class");
        $("["+fieldDataStoreKey+"]").removeAttr("data-sort-key");
    }
    function checkUnCheckAllCheckboxes(){
        console.log($('[id^="chk-sourcetype_"]'));
        var cls = "checkbox";
        selected_values_array = [];
        if(isSelectAll) {
            cls = "checkbox checked";
            $.each(searchAValues, function (index, value) { 
                selected_values_array.push(value);
            })
        }
        $('[id^="chk-sourcetype_"]').removeClass();
        $('[id^="chk-sourcetype_"]').addClass(cls);
    }

    $(document).ready(function () {
        //setting up tokens with selected value.
        $("#mybutton").on("click", function (e) {
            e.preventDefault();
            console.log(selected_values_array);
            tokens.set("mytoken", selected_values_array.join());
            submittedTokens.set(tokens.toJSON());
            $("#mybutton").attr('disabled', true);
        });
        // setCheckAllCheckBox();
        setTimeout(function(){
            setCheckAllCheckBox();
            console.log("In Wait");
        },2000);
    });
});
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;multiselect_table.css&lt;/STRONG&gt;&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;&lt;STRONG&gt;multiselect_table.xml&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form script="multiselect_table.js" stylesheet="multiselect_table.css"&amp;gt;
  &amp;lt;label&amp;gt;Multi-Select Table Rows Example&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false" autoRun="true"&amp;gt;
    &amp;lt;input type="text" token="tknSourcetype" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;tknSourcetype&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&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;amp;lt;br/&amp;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;amp;lt;br/&amp;amp;gt;
    &amp;lt;code&amp;gt;multiselect_table.css&amp;lt;/code&amp;gt;
        &amp;amp;lt;br/&amp;amp;gt;
    &amp;lt;code&amp;gt;multiselect_table.xml&amp;lt;/code&amp;gt;
        &amp;amp;lt;br/&amp;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 id="SearchA"&amp;gt;
          &amp;lt;query&amp;gt;index=_internal sourcetype="*$tknSourcetype$*" | stats count by sourcetype | eval CheckBox=sourcetype | table CheckBox sourcetype count&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;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="SearchB"&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;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2019 06:56:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459255#M33909</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-08-23T06:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to have a checkbox, check all the rows in the table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459256#M33910</link>
      <description>&lt;P&gt;@kamlesh_vaghela  Thank you so much for your answer. &lt;BR /&gt;
Its working as expected. &lt;BR /&gt;
Can u please let me know where can i learn java scripting for splunk? I want to write all these on my own &lt;span class="lia-unicode-emoji" title=":neutral_face:"&gt;😐&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Thanks once again &lt;/P&gt;</description>
      <pubDate>Sat, 24 Aug 2019 07:25:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459256#M33910</guid>
      <dc:creator>vasanthi77</dc:creator>
      <dc:date>2019-08-24T07:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to have a checkbox, check all the rows in the table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459257#M33911</link>
      <description>&lt;P&gt;@kamlesh_vaghela  one thing , I have added a filter to the form to get only some sourcetypes &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;     &amp;lt;dashboard script="multiselect_table.js" stylesheet="multiselect_table.css"&amp;gt;
        &amp;lt;label&amp;gt;Multi-Select Table Rows Example&amp;lt;/label&amp;gt;
        &amp;lt;fieldset submitButton="false" autoRun="true"&amp;gt;
         &amp;lt;input type="text" token="filter1"&amp;gt;
          &amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;
          &amp;lt;default&amp;gt;&amp;lt;/default&amp;gt;
         &amp;lt;/input&amp;gt;
        &amp;lt;/fieldset&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 id="SearchA"&amp;gt;
                &amp;lt;query&amp;gt;index=_internal |search sourcetype="%$filter1$%"| stats count by sourcetype | eval CheckBox=sourcetype | table CheckBox sourcetype count&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;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but when i select check box to check all , All soucretypes are coming as result , I want only filtered one in the result, Can pls u tell me how to do this one&lt;/P&gt;</description>
      <pubDate>Sat, 24 Aug 2019 08:04:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459257#M33911</guid>
      <dc:creator>vasanthi77</dc:creator>
      <dc:date>2019-08-24T08:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to have a checkbox, check all the rows in the table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459258#M33912</link>
      <description>&lt;P&gt;@vasanthi77&lt;/P&gt;

&lt;P&gt;I have updated my answer with respect to your concern. Can you please try and let me know?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 05:28:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459258#M33912</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-08-26T05:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to have a checkbox, check all the rows in the table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459259#M33913</link>
      <description>&lt;P&gt;Thanks @kamleshverma  its working, &lt;BR /&gt;
Sorry to bug you again , but one thing is,&lt;BR /&gt;
when we check it is getting to array but even when i uncheck it is still not deleting from array. &lt;BR /&gt;
I have added below code fr that , bt this is nt working for uncheckall option &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  SearchB.on('search:done', function(properties) {
               SearchA.startSearch();
               selected_values_array = [];
               tokens.set("mytoken", selected_values_array.join());
    });
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can u pls help me here.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2019 11:40:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459259#M33913</guid>
      <dc:creator>vasanthi77</dc:creator>
      <dc:date>2019-08-27T11:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to have a checkbox, check all the rows in the table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459260#M33914</link>
      <description>&lt;P&gt;@vasanthi77 &lt;/P&gt;

&lt;P&gt;Thanks for enhancing more &amp;amp; more it  :). I really appreciate your involvement. Please check my updated javascript code and try it.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2019 12:01:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459260#M33914</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-08-27T12:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to have a checkbox, check all the rows in the table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459261#M33915</link>
      <description>&lt;P&gt;@kamlesh_vaghela  Thanks its working as i expected. sorry fr responding late&lt;BR /&gt;
Thank you so much once again &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2019 00:56:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459261#M33915</guid>
      <dc:creator>vasanthi77</dc:creator>
      <dc:date>2019-08-30T00:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to have a checkbox, check all the rows in the table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459262#M33916</link>
      <description>&lt;P&gt;Glad to help you @vasanthi77 &lt;/P&gt;

&lt;P&gt;Can you please upvote my any comment which helps you for the learning purpose &amp;amp; accept this answer to close this question??&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2019 04:15:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459262#M33916</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-08-30T04:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to have a checkbox, check all the rows in the table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459263#M33917</link>
      <description>&lt;P&gt;@vasanthi77&lt;/P&gt;

&lt;P&gt;Can you please update on this question?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 04:55:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459263#M33917</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-09-05T04:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to have a checkbox, check all the rows in the table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459264#M33918</link>
      <description>&lt;P&gt;@kamlesh_vaghela  i already up voted for your comment. how to accept this as answer ? &lt;span class="lia-unicode-emoji" title=":neutral_face:"&gt;😐&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 05:51:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459264#M33918</guid>
      <dc:creator>vasanthi77</dc:creator>
      <dc:date>2019-09-05T05:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to have a checkbox, check all the rows in the table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459265#M33919</link>
      <description>&lt;P&gt;@vasanthi77&lt;/P&gt;

&lt;P&gt;By clicking "Accept” directly below the answer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;  &lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunkbase/splunkbase/Answers/Questions#Resolving_your_post"&gt;https://docs.splunk.com/Documentation/Splunkbase/splunkbase/Answers/Questions#Resolving_your_post&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 07:58:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459265#M33919</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-09-05T07:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to have a checkbox, check all the rows in the table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459266#M33920</link>
      <description>&lt;P&gt;done &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thanks @kamlesh_vaghela &lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 10:10:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/459266#M33920</guid>
      <dc:creator>vasanthi77</dc:creator>
      <dc:date>2019-09-05T10:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to have a checkbox, check all the rows in the table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/509007#M33921</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/172478"&gt;@vasanthi77&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the same&amp;nbsp;multiselect_table.js and&amp;nbsp;multiselect_table.css in splunk to get select all checkbox. But the select all checkbox is coming and disappearing after loading. Please help me on this&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Archana&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 08:07:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/509007#M33921</guid>
      <dc:creator>Archana944</dc:creator>
      <dc:date>2020-07-14T08:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to have a checkbox, check all the rows in the table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/509019#M33922</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/223682"&gt;@Archana944&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm assuming you have used js from accepted post. Can you please add&amp;nbsp;setTimeout and try again?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; // Add custom cell renderer and force re-render
tableView.table.addCellRenderer(new CustomRenderer());
tableView.table.render();
tableView.on('rendered', function(view) {
	setTimeout(function(){
    	setCheckAllCheckBox();
    },500);
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 09:13:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/509019#M33922</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2020-07-14T09:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to have a checkbox, check all the rows in the table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/509027#M33923</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Now the select all checkbox is appearing. But it is not checking all checkboxes. Please find my codes below.&lt;/P&gt;&lt;P&gt;my.js&lt;/P&gt;&lt;P&gt;require([&lt;BR /&gt;'underscore',&lt;BR /&gt;'jquery',&lt;BR /&gt;'splunkjs/mvc',&lt;BR /&gt;'splunkjs/mvc/tableview',&lt;BR /&gt;'splunkjs/mvc/simplexml/ready!',&lt;BR /&gt;'splunkjs/mvc/searchmanager'&lt;BR /&gt;], function(_, $, mvc, TableView) {&lt;BR /&gt;// Access the "default" token model&lt;BR /&gt;var tokens = mvc.Components.get("default");&lt;BR /&gt;var selected_values_array = [];&lt;BR /&gt;var query_array = [];&lt;BR /&gt;var query;&lt;BR /&gt;var fieldKey = "CheckBox";&lt;BR /&gt;var fieldDataStoreKey="data-sort-key="+fieldKey;&lt;BR /&gt;var isSelectAll = false;&lt;BR /&gt;var submittedTokens = mvc.Components.get('submitted');&lt;BR /&gt;var mySearchManager = "";&lt;BR /&gt;var SearchManager = require('splunkjs/mvc/searchmanager');&lt;BR /&gt;var CustomRangeRenderer = TableView.BaseCellRenderer.extend({&lt;BR /&gt;canRender: function(cell) {&lt;BR /&gt;return _([fieldKey]).contains(cell.field);&lt;BR /&gt;},&lt;BR /&gt;render: function($td, cell) {&lt;BR /&gt;var cls = "checkbox";&lt;BR /&gt;if(isSelectAll) {&lt;BR /&gt;cls = "checkbox checked";&lt;BR /&gt;}&lt;BR /&gt;var a = $('&amp;lt;div&amp;gt;').attr({"id":"chk-sourcetype"+cell.value,"value":cell.value}).addClass(cls).click(function() {&lt;BR /&gt;// console.log("checked",$(this).attr('class'));&lt;BR /&gt;// console.log("checked",$(this).attr('value'));&lt;BR /&gt;if($(this).attr('class')==="checkbox")&lt;BR /&gt;{&lt;BR /&gt;selected_values_array.push($(this).attr('value'));&lt;BR /&gt;$(this).removeClass();&lt;BR /&gt;$(this).addClass("checkbox checked");&lt;BR /&gt;}&lt;BR /&gt;else {&lt;BR /&gt;$(this).removeClass();&lt;BR /&gt;$(this).addClass("checkbox");&lt;BR /&gt;var i = selected_values_array.indexOf($(this).attr('value'));&lt;BR /&gt;if(i != -1) {&lt;BR /&gt;selected_values_array.splice(i, 1);&lt;BR /&gt;}&lt;BR /&gt;// Change the value of a token $mytoken$&lt;BR /&gt;}&lt;BR /&gt;con&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;//List of table IDs&lt;BR /&gt;var tableIDs = ["myTable"];&lt;BR /&gt;for (i=0;i&amp;lt;tableIDs.length;i++) {&lt;BR /&gt;var sh = mvc.Components.get(tableIDs[i]);&lt;BR /&gt;if(typeof(sh)!="undefined") {&lt;BR /&gt;sh.getVisualization(function(tableView) {&lt;BR /&gt;// Add custom cell renderer and force re-render&lt;BR /&gt;tableView.table.addCellRenderer(new CustomRangeRenderer());&lt;BR /&gt;tableView.table.render();&lt;BR /&gt;tableView.on('rendered', function(view) {&lt;BR /&gt;setTimeout(function(){&lt;BR /&gt;setCheckAllCheckBox();&lt;BR /&gt;},500);&lt;BR /&gt;});&lt;BR /&gt;});&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;var SearchA = mvc.Components.get("SearchA");&lt;BR /&gt;var SearchAResults = SearchA.data("results");&lt;BR /&gt;SearchAResults.on("data", function () {&lt;BR /&gt;resultArray = SearchAResults.data().rows;&lt;BR /&gt;searchAFields = SearchAResults.data().fields;&lt;BR /&gt;var keyIndex=searchAFields.indexOf(fieldKey);&lt;BR /&gt;searchAValues = [];&lt;BR /&gt;$.each(resultArray, function (index, value) {&lt;BR /&gt;searchAValues[index]=value[keyIndex];&lt;BR /&gt;})&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;function setCheckAllCheckBox()&lt;BR /&gt;{&lt;BR /&gt;// console.log("In setCheckAllCheckBox");&lt;BR /&gt;var a = $("["+fieldDataStoreKey+"]");&lt;BR /&gt;// console.log(a);&lt;BR /&gt;a.html("");&lt;BR /&gt;var cls = "checkbox";&lt;BR /&gt;if(isSelectAll) {&lt;BR /&gt;cls = "checkbox checked";&lt;BR /&gt;}&lt;BR /&gt;var temp = $('&amp;lt;div&amp;gt;').attr({&lt;BR /&gt;"id": "chk-sourcetype",&lt;BR /&gt;"value": "All"&lt;BR /&gt;}).addClass(cls).click(function () {&lt;BR /&gt;if ($(this).attr('class') === "checkbox") {&lt;BR /&gt;$(this).removeClass();&lt;BR /&gt;$(this).addClass("checkbox checked");&lt;BR /&gt;isSelectAll = true;&lt;BR /&gt;} else {&lt;BR /&gt;$(this).removeClass();&lt;BR /&gt;$(this).addClass("checkbox");&lt;BR /&gt;isSelectAll = false;&lt;BR /&gt;}&lt;BR /&gt;checkUnCheckAllCheckboxes();&lt;BR /&gt;}).appendTo(a);&lt;BR /&gt;$("["+fieldDataStoreKey+"]").parent().removeAttr("class");&lt;BR /&gt;$("["+fieldDataStoreKey+"]").removeAttr("data-sort-key");&lt;BR /&gt;}&lt;BR /&gt;function checkUnCheckAllCheckboxes(){&lt;BR /&gt;console.log($('[id^="chk-sourcetype_"]'));&lt;BR /&gt;var cls = "checkbox";&lt;BR /&gt;selected_values_array = [];&lt;BR /&gt;if(isSelectAll) {&lt;BR /&gt;cls = "checkbox checked";&lt;BR /&gt;$.each(searchAValues, function (index, value) {&lt;BR /&gt;selected_values_array.push(value);&lt;BR /&gt;})&lt;BR /&gt;}&lt;BR /&gt;$('[id^="chk-sourcetype_"]').removeClass();&lt;BR /&gt;$('[id^="chk-sourcetype_"]').addClass(cls);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;$(document).ready(function () {&lt;BR /&gt;$("#resubmit").on("click", function (e) {&lt;BR /&gt;e.preventDefault();&lt;BR /&gt;console.log("selectedarray"+selected_values_array);&lt;BR /&gt;for (q=0;q&amp;lt;selected_values_array.length;q++) {&lt;BR /&gt;var checkbox_query="| makeresults | eval Search_Query=\""+selected_values_array[q]+"\" | fields - _time | outputlookup append=true IIB_Dashboard_lookup.csv"&lt;BR /&gt;console.log(checkbox_query)&lt;BR /&gt;var epoch = (new Date).getTime();&lt;BR /&gt;mySearchManager = new SearchManager({&lt;BR /&gt;id : "lookup_search" + epoch,&lt;BR /&gt;earliest_time : "-24h",&lt;BR /&gt;latest_time : "now",&lt;BR /&gt;autostart : true,&lt;BR /&gt;search : checkbox_query,&lt;BR /&gt;preview : true,&lt;BR /&gt;cache : false&lt;BR /&gt;});&lt;BR /&gt;};&lt;BR /&gt;mvc.Components.get("SearchA").startSearch();&lt;BR /&gt;query=[];&lt;BR /&gt;for (u=0;u&amp;lt;selected_values_array.length;u++) {&lt;BR /&gt;query[u]="\""+selected_values_array[u]+",RESUBMIT\""&lt;BR /&gt;}&lt;BR /&gt;console.log(query.join(" "))&lt;BR /&gt;search_query(query.join(" "));&lt;BR /&gt;selected_values_array=[];&lt;BR /&gt;console.log(selected_values_array);&lt;BR /&gt;});&lt;BR /&gt;$("#archive").on("click", function (e) {&lt;BR /&gt;e.preventDefault();&lt;BR /&gt;console.log("selectedarray"+selected_values_array);&lt;BR /&gt;for (q=0;q&amp;lt;selected_values_array.length;q++) {&lt;BR /&gt;var checkbox_query="| makeresults | eval Search_Query=\""+selected_values_array[q]+"\" | fields - _time | outputlookup append=true IIB_Dashboard_lookup.csv"&lt;BR /&gt;console.log(checkbox_query)&lt;BR /&gt;var epoch = (new Date).getTime();&lt;BR /&gt;mySearchManager = new SearchManager({&lt;BR /&gt;id : "lookup_search" + epoch,&lt;BR /&gt;earliest_time : "-24h",&lt;BR /&gt;latest_time : "now",&lt;BR /&gt;autostart : true,&lt;BR /&gt;search : checkbox_query,&lt;BR /&gt;preview : true,&lt;BR /&gt;cache : false&lt;BR /&gt;});&lt;BR /&gt;};&lt;BR /&gt;mvc.Components.get("SearchA").startSearch();&lt;BR /&gt;query=[];&lt;BR /&gt;for (u=0;u&amp;lt;selected_values_array.length;u++) {&lt;BR /&gt;query[u]="\""+selected_values_array[u]+",ARCHIVE\""&lt;BR /&gt;}&lt;BR /&gt;console.log(query.join(" "))&lt;BR /&gt;search_query(query.join(" "));&lt;BR /&gt;selected_values_array=[];&lt;BR /&gt;console.log(selected_values_array);&lt;BR /&gt;});&lt;BR /&gt;function search_query (query) {&lt;BR /&gt;//var SearchManager = require('splunkjs/mvc/searchmanager');&lt;BR /&gt;var epoch = (new Date).getTime();&lt;BR /&gt;mySearchManager = new SearchManager({&lt;BR /&gt;id : "Soap_test" + epoch,&lt;BR /&gt;earliest_time : "-24h",&lt;BR /&gt;latest_time : "now",&lt;BR /&gt;autostart : true,&lt;BR /&gt;search : "| soap1 "+query,&lt;BR /&gt;preview : true,&lt;BR /&gt;cache : false&lt;BR /&gt;});&lt;BR /&gt;var confirmationMessage = mySearchManager.on('search:done', function(properties) {&lt;BR /&gt;console.log("DONE!\nSearch job properties:", properties.content.eventCount);&lt;BR /&gt;return "Job Completed";&lt;BR /&gt;});&lt;BR /&gt;console.log(confirmationMessage);&lt;BR /&gt;var myResults = mySearchManager.data("results");&lt;BR /&gt;console.log(myResults);&lt;BR /&gt;myResults.on("data", function () {&lt;BR /&gt;resultArray_rows = myResults.data().rows;&lt;BR /&gt;console.log(resultArray_rows)&lt;BR /&gt;tokens.set("mytoken1", resultArray_rows.join());&lt;BR /&gt;submittedTokens.set(tokens.toJSON());&lt;BR /&gt;console.log(tokens);&lt;BR /&gt;});&lt;BR /&gt;};&lt;BR /&gt;});&lt;BR /&gt;})&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 11:56:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/509027#M33923</guid>
      <dc:creator>Archana944</dc:creator>
      <dc:date>2020-07-14T11:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to have a checkbox, check all the rows in the table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/509176#M33934</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/223682"&gt;@Archana944&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did some correction in your javascript. Can you please try this?&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 query_array = [];
    var query;
    var fieldKey = "CheckBox";
    var fieldDataStoreKey = "data-sort-key=" + fieldKey;
    var isSelectAll = false;
    var submittedTokens = mvc.Components.get('submitted');
    var mySearchManager = "";
    var SearchManager = require('splunkjs/mvc/searchmanager');
    var CustomRangeRenderer = TableView.BaseCellRenderer.extend({
        canRender: function(cell) {
            console.log("IN render",cell.field);
            return _([fieldKey]).contains(cell.field);
        },
        render: function($td, cell) {
            console.log("checked",cell.value);
            var cls = "checkbox";
            if (isSelectAll) {
                cls = "checkbox checked";
            }
            var a = $('&amp;lt;div&amp;gt;').attr({
                "id": "chk-sourcetype" + cell.value,
                "value": cell.value
            }).addClass(cls).click(function() {
                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$
                }
            }).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();
                    tableView.on('rendered', function(view) {
                        setTimeout(function() {
                            setCheckAllCheckBox();
                        }, 500);
                    });
                });
            }
        }
        var SearchA = mvc.Components.get("SearchA");
        var SearchAResults = SearchA.data("results");
        SearchAResults.on("data", function() {
            resultArray = SearchAResults.data().rows;
            searchAFields = SearchAResults.data().fields;
            var keyIndex = searchAFields.indexOf(fieldKey);
            searchAValues = [];
            $.each(resultArray, function(index, value) {
                searchAValues[index] = value[keyIndex];
            })
        });

        function setCheckAllCheckBox() {
            // console.log("In setCheckAllCheckBox");
            var a = $("[" + fieldDataStoreKey + "]");
            // console.log(a);
            a.html("");
            var cls = "checkbox";
            if (isSelectAll) {
                cls = "checkbox checked";
            }
            var temp = $('&amp;lt;div&amp;gt;').attr({
                "id": "chk-sourcetype",
                "value": "All"
            }).addClass(cls).click(function() {
                if ($(this).attr('class') === "checkbox") {
                    $(this).removeClass();
                    $(this).addClass("checkbox checked");
                    isSelectAll = true;
                } else {
                    $(this).removeClass();
                    $(this).addClass("checkbox");
                    isSelectAll = false;
                }
                checkUnCheckAllCheckboxes();
            }).appendTo(a);
            $("[" + fieldDataStoreKey + "]").parent().removeAttr("class");
            $("[" + fieldDataStoreKey + "]").removeAttr("data-sort-key");
        }

        function checkUnCheckAllCheckboxes() {
            console.log($('[id^="chk-sourcetype_"]'));
            var cls = "checkbox";
            selected_values_array = [];
            if (isSelectAll) {
                cls = "checkbox checked";
                $.each(searchAValues, function(index, value) {
                    selected_values_array.push(value);
                })
            }
            $('[id^="chk-sourcetype_"]').removeClass();
            $('[id^="chk-sourcetype_"]').addClass(cls);
        }

        $(document).ready(function() {
            $("#resubmit").on("click", function(e) {
                e.preventDefault();
                console.log("selectedarray" + selected_values_array);
                for (q = 0; q &amp;lt; selected_values_array.length; q++) {
                    var checkbox_query = "| makeresults | eval Search_Query=\"" + selected_values_array[q] + "\" | fields - _time | outputlookup append=true IIB_Dashboard_lookup.csv"
                    console.log(checkbox_query)
                    var epoch = (new Date).getTime();
                    mySearchManager = new SearchManager({
                        id: "lookup_search" + epoch,
                        earliest_time: "-24h",
                        latest_time: "now",
                        autostart: true,
                        search: checkbox_query,
                        preview: true,
                        cache: false
                    });
                }
                mvc.Components.get("SearchA").startSearch();
                query = [];
                for (u = 0; u &amp;lt; selected_values_array.length; u++) {
                    query[u] = "\"" + selected_values_array[u] + ",RESUBMIT\""
                }
                console.log(query.join(" "))
                search_query(query.join(" "));
                selected_values_array = [];
                console.log(selected_values_array);
            });
            $("#archive").on("click", function(e) {
                e.preventDefault();
                console.log("selectedarray" + selected_values_array);
                for (q = 0; q &amp;lt; selected_values_array.length; q++) {
                    var checkbox_query = "| makeresults | eval Search_Query=\"" + selected_values_array[q] + "\" | fields - _time | outputlookup append=true IIB_Dashboard_lookup.csv"
                    console.log(checkbox_query)
                    var epoch = (new Date).getTime();
                    mySearchManager = new SearchManager({
                        id: "lookup_search" + epoch,
                        earliest_time: "-24h",
                        latest_time: "now",
                        autostart: true,
                        search: checkbox_query,
                        preview: true,
                        cache: false
                    });
                };
                mvc.Components.get("SearchA").startSearch();
                query = [];
                for (u = 0; u &amp;lt; selected_values_array.length; u++) {
                    query[u] = "\"" + selected_values_array[u] + ",ARCHIVE\""
                }
                console.log(query.join(" "))
                search_query(query.join(" "));
                selected_values_array = [];
                console.log(selected_values_array);
            });

            function search_query(query) {
                //var SearchManager = require('splunkjs/mvc/searchmanager');
                var epoch = (new Date).getTime();
                mySearchManager = new SearchManager({
                    id: "Soap_test" + epoch,
                    earliest_time: "-24h",
                    latest_time: "now",
                    autostart: true,
                    search: "| soap1 " + query,
                    preview: true,
                    cache: false
                });
                var confirmationMessage = mySearchManager.on('search:done', function(properties) {
                    console.log("DONE!\nSearch job properties:", properties.content.eventCount);
                    return "Job Completed";
                });
                console.log(confirmationMessage);
                var myResults = mySearchManager.data("results");
                console.log(myResults);
                myResults.on("data", function() {
                    resultArray_rows = myResults.data().rows;
                    console.log(resultArray_rows)
                    tokens.set("mytoken1", resultArray_rows.join());
                    submittedTokens.set(tokens.toJSON());
                    console.log(tokens);
                });
            }
        });
    });&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 15 Jul 2020 06:19:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/509176#M33934</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2020-07-15T06:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to have a checkbox, check all the rows in the table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/530144#M35991</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&amp;nbsp; Thanks for your help on multi select checkbox. I have one issue with code. The select all check box keeps disappearing after sometime ever after I added time out. Can you please help?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2020 23:02:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/530144#M35991</guid>
      <dc:creator>rteja9</dc:creator>
      <dc:date>2020-11-19T23:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to have a checkbox, check all the rows in the table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/533408#M36323</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any Idea on how to have toggle switch in every row of a table to enable and disable the alerts in splunk&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2020 07:03:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-have-a-checkbox-check-all-the-rows-in-the-table/m-p/533408#M36323</guid>
      <dc:creator>fgoljhgk</dc:creator>
      <dc:date>2020-12-17T07:03:54Z</dc:date>
    </item>
  </channel>
</rss>

