I have already bind a html table using jQuery json. I want to get multiple checkbox value using jQuery json and delete by selected multiple delete method. This is my code for bind the table.
$(function () {
debugger
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "WebForm5.aspx/BindDatatable",
data: "{}",
dataType: "json",
success: function (dt) {
debugger;
for (var i = 0; i < dt.d.length; i++) {
$("#example1 > tbody").append(" " + dt.d[i].CategoryID + " " + dt.d[i].Name + " " + dt.d[i].Status + " ");
}
$("#example1").DataTable();
},
error: function (result) {
alert("Error");
}
});
});
This is my Button to Delete selected(multiple delete):
This is my html table:
| Check Box | Category Name | Category Details | Status | Action |
|---|
Rajeev PunhaniRank #551 · 4.4K reputationPosted Jul 11, 2016, 12:35 AM EDT
Hi Manoj,
Please add value to each checkbox dt.d[i].CategoryID.
If the above solution is helpful then,accept the answer.
Manoj MaharanaRank #4,500 · 340 reputationPosted Jul 11, 2016, 1:31 AM EDT
Rajeev PunhaniRank #551 · 4.4K reputationPosted Jul 11, 2016, 2:32 AM EDT
Please find the sample html. In place of alert you can call your delete function. Also you need to populate the checkbox value to delete particular record.
If the above solution is helpful then,accept the answer.
Manoj MaharanaRank #4,500 · 340 reputationPosted Jul 11, 2016, 2:36 AM EDT
Rajeev PunhaniRank #551 · 4.4K reputationPosted Jul 11, 2016, 4:10 AM EDT
Hi Manoj,
What exactly do youneed? Please post aspx and aspx.cspage so that we canhelp you in a better way.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts