I have my grid:
$.fn.dataTable.ext.legacy.ajax = true;
var grid = $("#gridGrupo").dataTable({
"language": {
"url": "/Scripts/Libs/DataTables/ptBr.txt"
},
"processing": true,
"serverSide": true,
"ajax": "/grupo/data",
"order": [[0, "desc"]],
"columns": [
{ "data": "Id" },
{ "data": "Nome", },
{ "data": "Descricao" }
]
});
$('#gridGrupo tbody').on('click', 'tr', function () {
if ($(this).hasClass('row_selected')) {
$(this).removeClass('row_selected');
}
else {
grid.$('tr.row_selected').removeClass('row_selected');
$(this).addClass('row_selected');
}
});
It arrows the "row_selected" class when it selects a row
I have my function
function Editar(){
}
I need to get the line that it has selected, which has the class "row_selectd" to get the Id, and if it does not find, send a msg
I'm not getting the part to select the Id ..