Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all articles
Browse latest Browse all 1816

Clickable (http links) titles -- best way?

$
0
0
I would like the titles inside my toolbar to be clickable links. I can bury the markup inside the title attribute, but then that messes it up as an actual title (though most tables don't strictly need clean title attributes):

<table title="<a href='foo.jsp'>Foo</a>">etc..</table>

As you can see, that's not a well-formatted title attribute. The other option I've gone with thus far is to render the page, and then on document ready, find tables and grab the link from a "data-link" attribute I've created. Then I traverse the DOM to find the title in the toolbar and wrap it up with an anchor tag and HREF set to the data-link value.

<table title="foo" data-link="foo.jsp">etc..</table>

(grab the value of data-link, hunt down the title, and wrap it up in an appropriate anchor tag)

It works, but I feel like there must be a better way. DT is already building the toolbar DOM nodes, so I wonder if there's a way to specify this behaviour within DT itself. Any advice out there?

Viewing all articles
Browse latest Browse all 1816

Trending Articles