I have a table that needs to be updated by Ajax callback, I'm really struggling to find the right way to do so.
Here is a picture how the table should look like:
I cannot find the right way to so, here is my current HTML script:
<table class="table table-striped">
<thead>
<tr>
<th>#</th>
<th>12NC</th>
<th>Object Description</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row"><input id="ID"></th>
<td><input id="NC"></td>
<td><input id="Des"></td>
</tr>
</tbody>
And here is the callbacks from Ajax:
person_name:$('#input_text').val()
} ,
function (data)
{
obj1 = data[0];
obj2 = data[1];
var obj = JSON.parse(obj2);
var obj1 = JSON.parse(obj1);
$('#ID').val(obj1[1].id);
$('#NC').val(obj1[1].n_c);
$('#Des').val(obj[1].description);
}
);
})
}
);
Can someone please tell me if I'm doing it right and how I can send all the values from because now I can send only value 1 from the array.
