How change formar a field of datatables?
How change formar a field of datatables?
GeraDuron
Posts: 8Questions: 3Answers: 0
var editor;
$(document).ready(function () {
editor = new $.fn.dataTable.Editor({
ajax: '@Url.Action("DatosGrid2","Home")',
table: "#mensajes_editable",
fields:[
{
label: "Usuario",
name: "usuarios"
},
{
label: "Contraseña",
name: "contrasena",
type: "password"
},
{
label: "Rol",
name: "rol"
}
]
});
$('#mensajes_editable').DataTable(
{
ajax: '@Url.Action("DatosGrid2","Home")',
dom: "Bfrtip",
columns:[
{data:null,render: function(data,type,row){
return data.id;
}
},
{ data: "usuarios" },
{data: "contrasena"},
{data: "rol" },
],
select: true,
buttons: [
{ extend: "create", editor: editor },
{ extend: "edit", editor: editor },
{ extend: "remove", editor: editor }
]
});
} );
I need show the password field wih a format of ****
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
For the table you can use something like this to follow the pattern that the editor uses:
Just add the render function to your password column.
Kevin