data can do crud on the first page while on the second page and the next page does not work

data can do crud on the first page while on the second page and the next page does not work

hdscodehdscode Posts: 2Questions: 0Answers: 0
edited February 2020 in Free community support

Hello i have a little problem here, when i want to edit or delete my data on next page but my buttons is doesnt work, i just use datatables and modal, but this is very weird because i can edit and delete my data on the first page that just show 10 data.

Here for my script :

<script type="text/javascript">
            $(document).ready(function(){
                    $('.delete').on('click',function(){
                    $('#mytable').DataTable();
                    var userid=$(this).data('userid');
                    $('#ModalDelete').modal('show');
                    $('[name="kode"]').val(userid);
                });
            });
</script>

and here for my modal pop up :

    <form id="add-row-form" action="<?php echo base_url().'backend/clients/delete'?>" method="post" enctype="multipart/form-data">
    <div class="modal fade" id="ModalDelete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">Delete Clients</h4>
                </div>
                <div class="modal-body">
                        <strong>Anda yakin mau menghapus client ini?</strong>
                        <div class="form-group">
                            <input type="hidden" id="txt_kode" name="kode" class="form-control" required>
                        </div>

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
                    <button type="submit" id="add-row" class="btn btn-danger">Delete</button>
                </div>
            </div>
        </div>
    </div>
    </form>

Replies

This discussion has been closed.