<?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: Drilldown with javascript in a table format and using a token in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Drilldown-with-javascript-in-a-table-format-and-using-a-token/m-p/677364#M55474</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/245107"&gt;@wvalente2&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you looking for this?&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Splunk-Dev/Table-row-expansion-with-dynamic-search-in-the-JS/m-p/561412" target="_blank"&gt;https://community.splunk.com/t5/Splunk-Dev/Table-row-expansion-with-dynamic-search-in-the-JS/m-p/561412&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Please share more details of your requirements in case you need more details.&lt;/P&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.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Feb 2024 05:22:59 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2024-02-13T05:22:59Z</dc:date>
    <item>
      <title>Drilldown with javascript in a table format and using a token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Drilldown-with-javascript-in-a-table-format-and-using-a-token/m-p/676438#M55391</link>
      <description>&lt;P&gt;Hi Splunkers,&lt;/P&gt;&lt;P&gt;I need a help with my dashboard because of I`m stuck in this problem. I`ve already search, tried many javascript codes and still not working.&lt;/P&gt;&lt;P&gt;Basically what I need is:&amp;nbsp;&lt;/P&gt;&lt;P&gt;After clicking in a drilldown button , the result should be a table that show me more the details about a use case.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wvalente2_0-1706909360845.png" style="width: 760px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/29230i1DF77A41A4C8C811/image-dimensions/760x71?v=v2" width="760" height="71" role="button" title="wvalente2_0-1706909360845.png" alt="wvalente2_0-1706909360845.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Look at the first down arrow. When I click it should show me the details. But I cannot render a table.&lt;/P&gt;&lt;P&gt;The token to mue results should be the value os the use_case_name.&lt;/P&gt;&lt;P&gt;My javascript code:&lt;/P&gt;&lt;PRE&gt;&amp;nbsp;requirejs([&lt;BR /&gt;'../app/simple_xml_examples/libs/underscore-1.6.0-umd-min',&lt;BR /&gt;'splunkjs/mvc/tableview',&lt;BR /&gt;'splunkjs/mvc/chartview',&lt;BR /&gt;'splunkjs/mvc/searchmanager',&lt;BR /&gt;'splunkjs/mvc',&lt;BR /&gt;'splunkjs/mvc/simplexml/ready!'&lt;BR /&gt;], function(_, TableView, ChartView, SearchManager, mvc) {&lt;BR /&gt;var EventSearchBasedRowExpansionRenderer = TableView.BaseRowExpansionRenderer.extend({&lt;BR /&gt;initialize: function() {&lt;BR /&gt;// initialize will run once, so we will set up a search and a chart to be reused.&lt;BR /&gt;this._searchManager = new SearchManager({&lt;BR /&gt;id: 'details-search-manager',&lt;BR /&gt;preview: false&lt;BR /&gt;});&lt;BR /&gt;this._tableView = new TableView({&lt;BR /&gt;'managerid': 'details-search-manager',&lt;BR /&gt;'charting.legend.placement': 'none'&lt;BR /&gt;});&lt;BR /&gt;},&lt;BR /&gt;canRender: function(rowData) {&lt;BR /&gt;// Since more than one row expansion renderer can be registered we let each decide if they can handle that&lt;BR /&gt;// data&lt;BR /&gt;// Here we will always handle it.&lt;BR /&gt;return true;&lt;BR /&gt;},&lt;BR /&gt;render: function($container, rowData) {&lt;BR /&gt;// rowData contains information about the row that is expanded. We can see the cells, fields, and values&lt;BR /&gt;// We will find the sourcetype cell to use its value&lt;BR /&gt;var use_case_nameCell = _(rowData.cells).find(function (cell) {&lt;BR /&gt;return cell.field === 'use_Case_name';&lt;BR /&gt;});&lt;BR /&gt;//update the search with the sourcetype that we are interested in&lt;BR /&gt;// this._searchManager.set({ search: 'index=_internal sourcetype=' + sourcetypeCell.value + ' | table user | dedup user' });&lt;BR /&gt;this._searchManager.set({ search: '| inputlookup XXXX.csv | search use_case_name=' + use_case_nameCell.value + ' | table XXX | transpose' });&lt;BR /&gt;// $container is the jquery object where we can put out content.&lt;BR /&gt;// In this case we will render our chart and add it to the $container&lt;BR /&gt;// $container.append(this._chartView.render().el);&lt;BR /&gt;$container.append(this._tableView.render().el);&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;var tableElement = mvc.Components.getInstance('expand_with_events');&lt;BR /&gt;tableElement.getVisualization(function(tableView) {&lt;BR /&gt;// Add custom cell renderer, the table will re-render automatically.&lt;BR /&gt;tableView.addRowExpansionRenderer(new EventSearchBasedRowExpansionRenderer());&lt;BR /&gt;tableView.table.render();&lt;BR /&gt;});&lt;BR /&gt;});&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you guys.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 21:37:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Drilldown-with-javascript-in-a-table-format-and-using-a-token/m-p/676438#M55391</guid>
      <dc:creator>wvalente2</dc:creator>
      <dc:date>2024-02-02T21:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: Drilldown with javascript in a table format and using a token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Drilldown-with-javascript-in-a-table-format-and-using-a-token/m-p/677364#M55474</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/245107"&gt;@wvalente2&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you looking for this?&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Splunk-Dev/Table-row-expansion-with-dynamic-search-in-the-JS/m-p/561412" target="_blank"&gt;https://community.splunk.com/t5/Splunk-Dev/Table-row-expansion-with-dynamic-search-in-the-JS/m-p/561412&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Please share more details of your requirements in case you need more details.&lt;/P&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.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 05:22:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Drilldown-with-javascript-in-a-table-format-and-using-a-token/m-p/677364#M55474</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2024-02-13T05:22:59Z</dc:date>
    </item>
  </channel>
</rss>

