How can I add OnClick event to dc .DataTable cell?

How can I add OnClick event to dc .DataTable cell?

Bain McKayBain McKay Posts: 48Questions: 1Answers: 1

I tried to add onClick function to DC-JS.DataTable, but can't find a way to get it done. The alternative is to use DataTables. If I integrated DataTables, can I add an OnClick function to a Table cell?

Answers

  • bindridbindrid Posts: 730Questions: 0Answers: 119

    you should be able to add a click event to any table without issue.

    with jquery:

        $("tbody", "#example").on("click", "td",
                                 function() {alert(this.innerText); }) ;
    
    
  • allanallan Posts: 61,667Questions: 1Answers: 10,096 Site admin

    What is DC-JS.DataTable out of interest?

    Allan

  • Bain McKayBain McKay Posts: 48Questions: 1Answers: 1

    I realize I'm a year late responding to the above question from Allan - I just saw it. But if someone is looking for an answer to this question, here it is. It's still valid.

    DC-JS is a pivot API, created by Square and open sourced, that allows you to do scalable pivots (ref: Pivot Tables) in single page apps quickly. When used with D3, it allows you to create high quality bi-directonal graphical dashboards and infographics, through angular, for analytics. When you change a graphic, all graphics mapped to the pivots change reflexively. When custom binded to Datatables, you can drive the table to display rows reflective of the selected graphics. You can also select rows in the Table and have the dashboard reflect the Graphics view of the select rows. I implemented the first Datatables integration, but not the second one.

  • allanallan Posts: 61,667Questions: 1Answers: 10,096 Site admin

    Sounds cool :). Thanks!

    Allan

This discussion has been closed.