How to get the closest TR when clicking on a FIXED COLUMN
How to get the closest TR when clicking on a FIXED COLUMN
daveeeee
Posts: 8Questions: 3Answers: 0
I am using datatables and I have a FIXED COLUMN for edit delete function,
Currently, I want is when I click on edit the whole row will become editable with input.
Similar like this
http://plnkr.co/edit/B9fJQwgdLXEqBhrIJI76?p=preview
My issue is since I use FIX COLUMN, I cannot use now the function
$("#example").on('mousedown.edit', "i.fa.fa-pencil-square", function(e) {
$(this).removeClass().addClass("fa fa-envelope-o");
var $row = $(this).closest("tr").off("mousedown");
var $tds = $row.find("td").not(':first').not(':last');
$.each($tds, function(i, el) {
var txt = $(this).text();
$(this).html("").append("<input type='text' value=\""+txt+"\">");
});
});
Any help will be appreciated.
This discussion has been closed.
Answers
Hi @daveeeee ,
There's a lot there, different classes for example. We're happy to take a look. As per the forum rules, if you could link to a running test case showing the issue we can offer some help. 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
fixedColumns().rowIndex()
is probably what you want.Allan
Thans Allan!