<?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: Not able to apply dynamic image through JS in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Not-able-to-apply-dynamic-image-through-JS/m-p/557353#M65976</link>
    <description>&lt;P&gt;Hi,&amp;nbsp; I am not able to remove below scrollbar. Any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kajolsharma_0-1624861189361.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14838i1B78D86CB7E2C846/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kajolsharma_0-1624861189361.png" alt="kajolsharma_0-1624861189361.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Jun 2021 06:19:59 GMT</pubDate>
    <dc:creator>kajolsharma</dc:creator>
    <dc:date>2021-06-28T06:19:59Z</dc:date>
    <item>
      <title>Not able to apply dynamic image through JS</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Not-able-to-apply-dynamic-image-through-JS/m-p/557174#M65962</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Want to apply below arrow dynamically in my dashboard. Hav used custom JS and CSS for it. However, it is not working for my query :&lt;/P&gt;&lt;P&gt;index = *highjump_server*&lt;BR /&gt;| search Server_location=Abilene|rename Server_location as DC|table DC, Server_Msg,Server_type,Status_Code| stats sum(Status_Code) AS Status&lt;BR /&gt;| eval B=case (Status=0,"UP",Status=1,"DOWN") |eval _time=now()&lt;BR /&gt;|table B _time&lt;/P&gt;&lt;P&gt;Whereas it is working for |makeresults | eval A ="UP"| eval B="DOWN" | fields B.Not able to understand y though. Can you guys pls help here urgently ?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kajolsharma_0-1624617603549.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14819i50B07BD3023BCC3D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kajolsharma_0-1624617603549.png" alt="kajolsharma_0-1624617603549.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 10:44:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Not-able-to-apply-dynamic-image-through-JS/m-p/557174#M65962</guid>
      <dc:creator>kajolsharma</dc:creator>
      <dc:date>2021-06-25T10:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to apply dynamic image through JS</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Not-able-to-apply-dynamic-image-through-JS/m-p/557200#M65965</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/235797"&gt;@kajolsharma&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It should work with your search as well. Can you please your sample code for this? Meanwhile you can try this search also.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index = *highjump_server* Server_location=Abilene Status_Code=*
| stats sum(Status_Code) AS Status 
| eval B=case (Status=0,"UP",Status=1,"DOWN",1=1,"DOWN") 
| eval _time=now() 
| table B _time&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KV&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 13:37:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Not-able-to-apply-dynamic-image-through-JS/m-p/557200#M65965</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-06-25T13:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to apply dynamic image through JS</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Not-able-to-apply-dynamic-image-through-JS/m-p/557224#M65968</link>
      <description>&lt;P&gt;Thanks Kamlesh it worked.&lt;/P&gt;&lt;P&gt;Meanwhile I hav got another issue ,the JS what i hav written works for single panel id. However i hav 19 such panels. How should i modify it ?Any suggestions. Below is JS which i am using :&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) {



    var CustomRangeRenderer = TableView.BaseCellRenderer.extend({
        canRender: function(cell) {
            return cell.field;
        },
        render: function($td, cell) {
            var value = cell.value;
            
            if(value=="UP" )
                {
                    $td.html("&amp;lt;div class='up'&amp;gt; &amp;lt;/div&amp;gt;")
                }
            else if(value=="DOWN")
            {
                    $td.html("&amp;lt;div class='down'&amp;gt; &amp;lt;/div&amp;gt;")
            }
            else if(value=="UNKNOWN" || value=="N/A")
            {
                    $td.html("&amp;lt;div class='unknown'&amp;gt; &amp;lt;/div&amp;gt;")
            }
            else if(value=="WARN")
            {
                    $td.html("&amp;lt;div class='warn'&amp;gt; &amp;lt;/div&amp;gt;")
            }
                
		}

       
    });

 var sh = mvc.Components.get("sample");
    if(typeof(sh)!="undefined") {
        sh.getVisualization(function(tableView) {
            // Add custom cell renderer and force re-render
                         tableView.table.addCellRenderer(new CustomRangeRenderer());
                                     tableView.table.render();
									
                                             });
                                                 }



                                                    });
											&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 25 Jun 2021 17:11:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Not-able-to-apply-dynamic-image-through-JS/m-p/557224#M65968</guid>
      <dc:creator>kajolsharma</dc:creator>
      <dc:date>2021-06-25T17:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to apply dynamic image through JS</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Not-able-to-apply-dynamic-image-through-JS/m-p/557225#M65969</link>
      <description>&lt;P&gt;Yes&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/235797"&gt;@kajolsharma&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can apply the common logic as many panels you want.&lt;/P&gt;&lt;P&gt;Just check below JS. I have added some logic for multiple panels.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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) {

    var CustomRangeRenderer = TableView.BaseCellRenderer.extend({
        canRender: function(cell) {
            return cell.field;
        },
        render: function($td, cell) {
            var value = cell.value;

            if (value == "UP") {
                $td.html("&amp;lt;div class='up'&amp;gt; &amp;lt;/div&amp;gt;")
            } else if (value == "DOWN") {
                $td.html("&amp;lt;div class='down'&amp;gt; &amp;lt;/div&amp;gt;")
            } else if (value == "UNKNOWN" || value == "N/A") {
                $td.html("&amp;lt;div class='unknown'&amp;gt; &amp;lt;/div&amp;gt;")
            } else if (value == "WARN") {
                $td.html("&amp;lt;div class='warn'&amp;gt; &amp;lt;/div&amp;gt;")
            }

        }
    });

    //List of table IDs to add icon
    var tableIDs = ["sample", "sample1", "sample2", "samplen", "sample19"];
    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();
            });
        }
    }
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this will help you.&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&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>Fri, 25 Jun 2021 18:07:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Not-able-to-apply-dynamic-image-through-JS/m-p/557225#M65969</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-06-25T18:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to apply dynamic image through JS</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Not-able-to-apply-dynamic-image-through-JS/m-p/557229#M65971</link>
      <description>&lt;P&gt;I think there is a slight modification&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;//List of table IDs to add icon
    var tableIDs = ["sample", "sample1", "sample2", "samplen", "sample19"];
    for (i = 0; i &amp;lt; tableIDs.length; i++) {
        //var sh = mvc.Components.get("sample");
        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();
            });
        }
    }
});&lt;/LI-CODE&gt;&lt;P&gt;correction&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 17:54:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Not-able-to-apply-dynamic-image-through-JS/m-p/557229#M65971</guid>
      <dc:creator>kajolsharma</dc:creator>
      <dc:date>2021-06-25T17:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to apply dynamic image through JS</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Not-able-to-apply-dynamic-image-through-JS/m-p/557231#M65972</link>
      <description>&lt;P&gt;Yes&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/235797"&gt;@kajolsharma&lt;/a&gt;&amp;nbsp; I have updated my answer.&lt;/P&gt;&lt;P&gt;Glad to help you. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 18:08:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Not-able-to-apply-dynamic-image-through-JS/m-p/557231#M65972</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-06-25T18:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to apply dynamic image through JS</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Not-able-to-apply-dynamic-image-through-JS/m-p/557353#M65976</link>
      <description>&lt;P&gt;Hi,&amp;nbsp; I am not able to remove below scrollbar. Any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kajolsharma_0-1624861189361.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14838i1B78D86CB7E2C846/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kajolsharma_0-1624861189361.png" alt="kajolsharma_0-1624861189361.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 06:19:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Not-able-to-apply-dynamic-image-through-JS/m-p/557353#M65976</guid>
      <dc:creator>kajolsharma</dc:creator>
      <dc:date>2021-06-28T06:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to apply dynamic image through JS</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Not-able-to-apply-dynamic-image-through-JS/m-p/557355#M65977</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/235797"&gt;@kajolsharma&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please share your code?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 06:33:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Not-able-to-apply-dynamic-image-through-JS/m-p/557355#M65977</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-06-28T06:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to apply dynamic image through JS</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Not-able-to-apply-dynamic-image-through-JS/m-p/557356#M65978</link>
      <description>&lt;LI-CODE lang="markup"&gt;    &amp;lt;panel id="sk1"&amp;gt;
      &amp;lt;title&amp;gt;ABILENE&amp;lt;/title&amp;gt;
      &amp;lt;html&amp;gt;

&amp;lt;head&amp;gt;

&amp;lt;style&amp;gt;

          .down {
              background-image: url('/static/app/ERPTower/downarrow.png') !important;
              background-repeat: no-repeat !important;
              background-size: 50px 50px; !important;
              width: 280px; !important;
              height: 100px; !important;
              background-position: center; !important;
              position: relative; !important;
          }

          .up {
              background-image: url('/static/app/ERPTower/up2.png') !important;
              background-repeat: no-repeat !important;
              background-size: 50px 50px; !important;
              width: 280px; !important;
              height: 100px; !important;
              background-position: center; !important;
              position: relative; !important;
              }

&amp;lt;/style&amp;gt;

&amp;lt;/head&amp;gt;

&amp;lt;/html&amp;gt;
      &amp;lt;html&amp;gt;
      &amp;lt;div&amp;gt;
      &amp;lt;img class="center" height="240px" width="220px" src="/static/app/ERPTower/warehouse2.png"/&amp;gt;
      &amp;lt;/div&amp;gt;
      &amp;lt;/html&amp;gt;
      &amp;lt;table id="sample"&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;!--&amp;lt;query&amp;gt;|makeresults | eval A ="UP"| eval B="DOWN" | fields B|rename B AS " "&amp;lt;/query&amp;gt;--&amp;gt;
          &amp;lt;query&amp;gt;index = *highjump_server* 
| search Server_location=Abilene| stats sum(Status_Code) AS Status 
| eval B=case (Status=0,"UP",Status=1,"DOWN") |eval _time=now()
| table B|rename B as " "&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$time.earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$time.latest$&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;cell&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;link target="_blank"&amp;gt;/app/ERPTower/high_jump_kpis_in_progress&amp;lt;/link&amp;gt;
        &amp;lt;/drilldown&amp;gt;
      &amp;lt;/table&amp;gt;
      &amp;lt;html id="alertbar"&amp;gt;
        &amp;lt;div&amp;gt;
          &amp;lt;span class="fas fa-exclamation-triangle" style="color: red; margin-right: 5px; margin-left: 5px;"/&amp;gt;
          &amp;lt;a href="batch_alert_analytics" target="_new" style="color: white; margin-right:5px;"&amp;gt;Notifications: $sd$&amp;lt;/a&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/html&amp;gt;
      &amp;lt;html&amp;gt;
      &amp;lt;style&amp;gt;
              
      div#alertbar {
      bottom: 0px;
      background: #4d4e61;
      border-radius: 0px 0px 5px 5px;
      vertical-align: bottom;
      position: absolute;
      }
     
   #sk1{
          width: 20% !important;
          align: center !important;
          text-align: center !important;
          padding: 0px !important;
          margin: 0px 0px 0px 0p !important;
          
          }
    
    
  &amp;lt;/style&amp;gt;
  &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 28 Jun 2021 06:39:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Not-able-to-apply-dynamic-image-through-JS/m-p/557356#M65978</guid>
      <dc:creator>kajolsharma</dc:creator>
      <dc:date>2021-06-28T06:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to apply dynamic image through JS</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Not-able-to-apply-dynamic-image-through-JS/m-p/557372#M65981</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/235797"&gt;@kajolsharma&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not able to reproduce the issue. But you can try&amp;nbsp;&lt;STRONG&gt;overflow: hidden;.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2021-06-28 at 2.08.04 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14839i88561C93B9F89482/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-06-28 at 2.08.04 PM.png" alt="Screenshot 2021-06-28 at 2.08.04 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;kV&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 08:38:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Not-able-to-apply-dynamic-image-through-JS/m-p/557372#M65981</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-06-28T08:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to apply dynamic image through JS</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Not-able-to-apply-dynamic-image-through-JS/m-p/558284#M66038</link>
      <description>&lt;P&gt;How can we implement tooltip for the below arrow&amp;nbsp; ? Tooltip can include search query which gives results for which server is UP....For example: Webserver: Up&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kajolsharma_1-1625473917052.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14934i26CC0AB00EA4F097/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kajolsharma_1-1625473917052.png" alt="kajolsharma_1-1625473917052.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 08:42:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Not-able-to-apply-dynamic-image-through-JS/m-p/558284#M66038</guid>
      <dc:creator>kajolsharma</dc:creator>
      <dc:date>2021-07-05T08:42:26Z</dc:date>
    </item>
  </channel>
</rss>

