Good morning, see if you can help me: I have an ajax request so what:
function getData(){
$.ajax({
url: url_serv,
type: 'GET',
dataType: 'json',
success: function(data){
imprimir(data);
}
.... in print I do the following:
function imprimir(datos) {
$('#miTable').DataTable({
data: datos,
columns:[
{ "data": "id" },
{ "data": "name" },
{ "data": "publish"},
{ "render":
function ( data, type, row ) {
Aquí metere el boton para modificar y que invoque a Dialog.
....código faltante....
}
}
]
});
}
I have to add a sixth column that is a button to modify any of the rows, it is assumed that by pressing that button, a dialog with the aplog Dialog of JQuery and the data (The dialog I have created it). But to modify the row or data, I have to use "render" ... and then there make a put request to the server to modify it, but I'm lost in how to do it.
Can someone help me or indicate a little where to shoot?
HTML Code:
<body>
<button id="cargar">Get JSON data</button>
<table id="miTable" width="100%"></table>
<div id="dialog-form" title="Modificar pelicula">
<p> Modifique los campos: </p>
<form>
<fieldset>
<label for="id">ID:</label>
<input type="text" name="id" id="id">
<label for="name">Nombre:</label>
<input type="text" name="name" id="name">
<label for="publish">Publicación:</label>
<input type="date" name="publicacion" id="publish">
</fieldset>
</form>
</div>
</body>