polywc / polywc-data-table

HTML table, a reusable Polymer web-component.
http://polywc.github.io/polywc-data-table/
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Provide an on-click attribute on the data table #42

Closed donpir closed 7 years ago

donpir commented 8 years ago

The on-click attribute is useful to specify a function to call when the user clicks on the table items.

Actually to do this, the user need to write this type of code

 <script>
    var $tbl = document.querySelector("#tbl");

    $tbl.addEventListener('data-table-item-clicked-event', function (evt) {
        var item = evt.detail.item;
        console.log(item);
    });
</script>