I want to select a row data group in the table based on the id coming to the upNews() method. Then I want to show some column values (like Id, Name, Date) on the alert screen after I split the data in the selected row. I am having trouble retrieving and/or parsing Datetime2 format data contained in the array. How can I run this with Ajax?
var selectedValue;
function upNews(pid) {
var table = $('#kt_datatable').DataTable();
selectedValue = table.data().filter(x => x.Id == pid)[0];
$('#idd').val(selectedValue.Id);
$('#nm').val(selectedValue.Name);
/* I'm having trouble using the substring() method. */
$('#dt').val(selectedValue.Date.text.substring(0,10));
alert(selectedValue.Date);