<?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 Can I make two mvc.Components.get? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-make-two-mvc-Components-get/m-p/138126#M8310</link>
    <description>&lt;PRE&gt;&lt;CODE&gt; mvc.Components.get('highlight').getVisualization(function(tableView) {
        // Add custom cell renderer
        tableView.table.addCellRenderer(new RangeMapIconRenderer());
        tableView.table.addCellRenderer(new CustomRangeRenderer());
        tableView.on('rendered', function() {
            // Apply class of the cells to the parent row in order to color the whole row
            tableView.$el.find('td.range-cell').each(function() {
                $(this).parents('tr').addClass(this.className);
            });
        });
        // Force the table to re-render
        tableView.table.render();
    });




 mvc.Components.get('highlight2').getVisualization(function(tableView) {
        // Add custom cell renderer
        tableView.table.addCellRenderer(new RangeMapIconRenderer());
        tableView.table.addCellRenderer(new CustomRangeRenderer());
        tableView.on('rendered', function() {
            // Apply class of the cells to the parent row in order to color the whole row
            tableView.$el.find('td.range-cell').each(function() {
                $(this).parents('tr').addClass(this.className);
            });
        });
        // Force the table to re-render
        tableView.table.render();
    });
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to prevent adding multiple js in one dashboard? and also can I ask what framework is mvc.Components.get? is it backbone or the splunk itself? Thanks&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jul 2015 03:50:57 GMT</pubDate>
    <dc:creator>josefa123</dc:creator>
    <dc:date>2015-07-27T03:50:57Z</dc:date>
    <item>
      <title>Can I make two mvc.Components.get?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-make-two-mvc-Components-get/m-p/138126#M8310</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; mvc.Components.get('highlight').getVisualization(function(tableView) {
        // Add custom cell renderer
        tableView.table.addCellRenderer(new RangeMapIconRenderer());
        tableView.table.addCellRenderer(new CustomRangeRenderer());
        tableView.on('rendered', function() {
            // Apply class of the cells to the parent row in order to color the whole row
            tableView.$el.find('td.range-cell').each(function() {
                $(this).parents('tr').addClass(this.className);
            });
        });
        // Force the table to re-render
        tableView.table.render();
    });




 mvc.Components.get('highlight2').getVisualization(function(tableView) {
        // Add custom cell renderer
        tableView.table.addCellRenderer(new RangeMapIconRenderer());
        tableView.table.addCellRenderer(new CustomRangeRenderer());
        tableView.on('rendered', function() {
            // Apply class of the cells to the parent row in order to color the whole row
            tableView.$el.find('td.range-cell').each(function() {
                $(this).parents('tr').addClass(this.className);
            });
        });
        // Force the table to re-render
        tableView.table.render();
    });
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to prevent adding multiple js in one dashboard? and also can I ask what framework is mvc.Components.get? is it backbone or the splunk itself? Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2015 03:50:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-make-two-mvc-Components-get/m-p/138126#M8310</guid>
      <dc:creator>josefa123</dc:creator>
      <dc:date>2015-07-27T03:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: Can I make two mvc.Components.get?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-make-two-mvc-Components-get/m-p/138127#M8311</link>
      <description>&lt;P&gt;Yes, you can add as much javascript to one file as you see fit (although it may be a good idea to split them if the code they contain do different jobs). You can also re-use the same .js in multiple dashboards if they require the same code.&lt;/P&gt;

&lt;P&gt;As I just replied to your other question, I believe the &lt;CODE&gt;mvc.Components.get()&lt;/CODE&gt; is from backbone.js.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2015 08:05:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-make-two-mvc-Components-get/m-p/138127#M8311</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2015-07-27T08:05:01Z</dc:date>
    </item>
  </channel>
</rss>

