Heizengberg
Eternal Poster
- Joined
- Jul 12, 2017
- Posts
- 597
- Reaction
- 120
- Points
- 282
mga sir gagawa sana ako ng multiple deletion using php/js so ang logic is may magclick ka nga mga checkbox ng mga rows na gusto mi alisn then click the delete button.
so ang naisip kong way is to loop through the table at kunin yung id. but the problem is data table has an default pagination. so bali ang naloloopan lang ng code ko is yung 1stpage. eto sya
$('#sample_btn').click(function(e){
e.preventDefault();
// Declare ko muna array
var ids = [];
$(".to_array").each(function () {
if($(this).is(":checked")) {
ids.push($(this).val());
}
});
alert(ids)
});
so ang naisip kong way is to loop through the table at kunin yung id. but the problem is data table has an default pagination. so bali ang naloloopan lang ng code ko is yung 1stpage. eto sya
$('#sample_btn').click(function(e){
e.preventDefault();
// Declare ko muna array
var ids = [];
$(".to_array").each(function () {
if($(this).is(":checked")) {
ids.push($(this).val());
}
});
alert(ids)
});