javascriptrubycoffeescriptdashboarddashing

Dashing dashboard linking widgets


I am having a hard time linking widgets on my dashing dashboard. I read another post and got some help from dashing community, but, just am not able to link widgets

I have my text.coffee modified to have this section (sample is my other dashboard)

click: (event) ->
  location.href = "sample"

When I click on my text widget nothing happens. I also tried doing this, but nothing.

click: (event) ->
  location.href = "www.stackoverflow.com"

However, when I just add below line to onData section of my meter.coffee it redirects to stackoverflow.com.

location.href = "www.stackoverflow.com"

What am I doing wrong? Do you have an example that I can try out?

EDIT1:

I also tried the below suggestion without any luck.

click: (e) ->
  e.preventDefault()
  location.href = "http://www.stackoverflow.com"

Solution

  • Got help from the dashing community. Here is how it works. Just modify your dashboard erb to link the page you want to see

    <li data-row="2" data-col="2" data-sizex="2" data-sizey="1" onclick="location.href='http://www.stackoverflow.com';">
      <div data-id="test_text_widget" data-view="Text" data-title="Test"</div>
    </li>