Trigger a row button programmaticaly on dblclick
Trigger a row button programmaticaly on dblclick
Nico1904
Posts: 7Questions: 3Answers: 0
Hello everyone,
I have created a table using datatable serverside.
In my columnDef, I define this columns :
{
"render": function ( data, type, row ) {
return '<a class="js-popin" href="{% url 'main:client_info' %}" data-popin-size="big" data-popin-type="card"><i class="c-fonticon__icon-plus"></i></a>'
},
"targets": 10,
orderable:false,
},
I can select a row by this way :
$('#table_client tbody').on( 'dblclick', 'tr', function () {
var id = table.row( table.$(this) ).data().id;
alert( 'You clicked on '+id+'\'s row' );
} );
What I would like to do is trigger the row button on double click on the corresponding row.
Is it something possible ?
This discussion has been closed.
Answers
By the "row button", do you mean the
a
element?Allan
Exactly,
Infurtunatly it don't work, it simulate a click on the first row and not on the a tag.
I have added table.$(this) in $('a.js-popin', table.row(table.$(this)).node()).click() but it don't work too.
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin