PHP jquery datatables with CRUD just can edit pages 1
PHP jquery datatables with CRUD just can edit pages 1
developerbayu
Posts: 5Questions: 0Answers: 0
Hello everyone,
I'm using jquery datatables but there's something problem.
I have total 11 records. Data tables show me 10 entries of record from database and I add column for edit and delete
when I click pagination button (next) , data tables show me record from pages 2 (record number 11 etc), but the button of edit and delete is not work
Can you help me ?
this is my link to the application
http://49.128.179.27/kbk_si/pages/ketua/data_dosen
Hope can help me :) because i'm newbie for datatables
I'm using jquery datatables but there's something problem.
I have total 11 records. Data tables show me 10 entries of record from database and I add column for edit and delete
when I click pagination button (next) , data tables show me record from pages 2 (record number 11 etc), but the button of edit and delete is not work
Can you help me ?
this is my link to the application
http://49.128.179.27/kbk_si/pages/ketua/data_dosen
Hope can help me :) because i'm newbie for datatables
This discussion has been closed.
Replies
Allan
Thanks for your feedback,
but after i use that method , the results is same.
:(
Allan
I was add record please check :)
===
After click edit modal on page 1 ,
when on page 2 , the modal is same as id on page 1
Still not work on page 2
[code]
$( ".delbutton" ).on( "click", function() {
//Save the link in a variable called element
var element = $(this);
//Find the id of the link that was clicked
var del_id = element.attr("id");
//Built a url to send
var info = 'id=' + del_id;
if(confirm("Are you sure you want to delete this Lecturer ? NIK : "+del_id)){
$.ajax({
type: "POST",
url: "inc_/delete_dosen",
data: info,
success: function(data){
$("#loading2").html('Loading data... ').show();
setTimeout(function() {
$("#loading2").fadeIn();
setTimeout(function() {
$("#loading2").slideUp('slow');
},4000);
$("#loading2").html(data);
},1000);
}
});
}
return false;
});
[/code]
> $( ".delbutton" ).on( "click", function() {
Is a static event. You want to use a delegate event.
[code]
$( document ).on( "click", ".delbutton", function() {
[/code]
sorry my fault .
i'm new on javascript hahaha
Thanks allan for your advice ,
now work on my localhost.
Thank you very much!!!!