I'm creating a new row in string format like s="
<tr><td></td></tr>
"
and returning it by webmethod to ajax.
ajax({
type: "POST",
url: "notification.aspx/ReturnTableRow",
data: JSON.stringify({ maxidfetched: maxid, empid: empid }),
contentType: "application/json; charset=utf-8",
dataType: "json",
beforeSend: function () {
},
success: function (response) {
if (response.d.trim() != "") {
tbl.prepend(response.d);
}
},
failure: function (response) {
//alert(response.d);
}
});
response.d is returned row element as string.
I have tbl which is initialized as datatable and row will be added to it.
but after adding row to tbl how to reinitialize it?
on form load if I initialize tbl then datatable structure is created.
but after prepending the row element the structure destroyed.
There are many helps in internet to add rows as
rows.add(
[]);
but it just add cells and create a new row.It doesn't have flexibility.
I I want to write a tr element then how to do it?