Dashboards & Visualizations

TypeError: mvc.Components.get(...) is undefined

rijk
Explorer

I try to follow the example 'Table Cell Highlighting' in the App: Splunk 6.x Dashboard Examples. After adding the script and css to /opt/splunk/etc/apps/search/appserver/static the browser console displays:

TypeError: mvc.Components.get(...) is undefined
mvc.Components.get('highlight').getVisualization(function(tableView) {

I only adjusted the field names to represent the fieldnames in my own table. Can someone please tell me what I am missing?

Tags (2)

jbrodsky_splunk
Splunk Employee
Splunk Employee

The reason that you are getting this is because your table definition needs an ID.

If you look at the .js script, and the error you posted above, it says this:

mvc.Components.get('highlight').

That is the tip off. What you need to have in your SimpleXML table definition is this:

<table id='highlight'>

Yours probably just looks like:

<table>

...which will not work, and results in the above error.

Make that change, restart splunkweb, clear your browser cache, and it should work. Easy to miss that, and the error message makes it seem like you're missing a JavaScript dependency of sorts.

bhawkins1
Communicator

Is this not documented anywhere? the mvc.Components.get() method doesn't seem to even have a reference, only examples with names like "myview" which could mean anything - token, id, class, and so on.

0 Karma

ss026381
Communicator
0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...