How do I get the value of a tag when I double-click it and get that value and move to a method in my controller. The double click function is working.
$('#nmUsuario').on("dblclick", '.clique', function() {
CarregaDados();
})
Where nmUsuario is the tbody of my table. My method CarregaDados();
is where I want to get the value of the clicked tag and pass it to the controller via json.
function CarregaDados() {
$('.rowid').find('td').each(function () {
var test = $(this).text();
alert(test);
})
$.ajax({
url: '/CadastroAcesso/CarregaDadosPagina',
datatype: 'json',
contentType: 'application/json;charset=utf-8',
type: 'POST',
data: JSON.stringify({ aqui não sei o que passar }),
success: function (data) {
alert('Alô, tudo bem?');
},
error: function (error) {
}
})
}
Where rowid is my <TR>
, however, since I want to get only the clicked tag, does it make sense to do each? The code I made before ajax, does not enter the alert. I do not know the test value.
public JsonResult CarregaDadosPagina(string _nivel, string _nome, string _usuario)
{
RupturaEntities db = new RupturaEntities();
//var result_carrega_pagina = db.
return Json(new { }, JsonRequestBehavior.AllowGet);
}