• 09-05-2022, 22:58:13
    #1
    Selamlar arkadaşalar.
    Sayfamda bilgileri listelediğim bir datatable var.
    Ve her satırda birtane butonum var.
    Bir nevi silme işlevi görüyor.
    Datable ilk sayfada sorunsuz bir şekilde çalışıyorken 2. sayfada buton işlevini yitiriyor ve çalışmıyor.
    Bu sorunun önüne nasıl geçebilirim.
    TABLOM
    <table id="data-table-default" class="table table-striped table-bordered table-td-valign-middle">
                    <thead>
                        <tr style="font-size: 15px!important;">
    
                            <th class="text-nowrap" data-orderable="false"><?php echo $opportunitiesLang['title'] ?></th>
                            <th class="text-nowrap"><?php echo $opportunitiesLang['customer'] ?></th>
                            <th class="text-nowrap"><?php echo $opportunitiesLang['published'] ?></th>
                            <th class="text-nowrap"><?php echo $opportunitiesLang['deadLine'] ?></th>
                            <th class="text-nowrap"><?php echo $opportunitiesLang['categories'] ?></th>
                            <th class="text-nowrap"><?php echo $opportunitiesLang['source'] ?></th>
                            <th class="text-nowrap"><?php echo $opportunitiesLang['action'] ?></th>
                        </tr>
                    </thead>
                    <tbody>
    
                        <?php $sql=$db->qSql("SELECT * FROM tenders where status=1");
                        $getData=$sql->fetchAll(PDO::FETCH_ASSOC);
    
                        foreach ($getData as $tenders) { ?>
                            <tr class="odd gradeX" height="40px" style="font-size: 14px!important;" id="secret<?php echo $tenders['id']; ?>">
                                <td width="30%"><?php echo $tenders['name']; ?></td>
                                <td><?php echo $tenders['buyer']; ?></td>
                                <td class="text-center"><?php echo $newformat ?></td>
                                <td class="text-center">
                              
                                </td>
                                <td><?php echo $tenders['tenderType'] ?></td>
                                <td><a href="<?php echo $tenders['link']; ?>" target="_blank"><?php echo $tenders['source']; ?></a></td>
                                <td>
                                    <button class="btn btn-danger btn-xs btn-block">Register</button>
                                    <button class="btn btn-secondary btn-xs btn-block rejectTender" id="<?php echo $tenders['id']; ?>" name="rejectTender">Reject</button>
                                </td>
                            </tr>
    
                        <?php } ?>
    
                    </tbody>
                </table>
    AJAX KODUM
    <script>
        $(document).ready(function () {
            $('.rejectTender').click(function (event) {      
                swal({
                    title: title,
                    text: Desc,
                    icon: 'error',
                    buttons: true,
                    dangerMode: true,
                }).then((result) => {
                    if (result) {
                        $.ajax({
                            type: 'POST',
                            url: '../../config/updateProcess.php',    
                            data: { id:id, rejectTender:rejectTender},
                            success: function (result) {                        
    
                                if($.trim(result) == "error") {
                                } else if(result == "ok") {
                                    sweetAlert(ok, okDesc, 'success').then($("#secret"+id).hide());
                                }
                            },
                        });
                    }
                });
            });
        });
    </script>
    [B][/B]
  • 09-05-2022, 23:04:54
    #2
    Üyeliği durduruldu
    emrezsy adlı üyeden alıntı: mesajı görüntüle
    Selamlar arkadaşalar.
    Sayfamda bilgileri listelediğim bir datatable var.
    Ve her satırda birtane butonum var.
    Bir nevi silme işlevi görüyor.
    Datable ilk sayfada sorunsuz bir şekilde çalışıyorken 2. sayfada buton işlevini yitiriyor ve çalışmıyor.
    Bu sorunun önüne nasıl geçebilirim.
    TABLOM
    <table id="data-table-default" class="table table-striped table-bordered table-td-valign-middle">
                    <thead>
                        <tr style="font-size: 15px!important;">
    
                            <th class="text-nowrap" data-orderable="false"><?php echo $opportunitiesLang['title'] ?></th>
                            <th class="text-nowrap"><?php echo $opportunitiesLang['customer'] ?></th>
                            <th class="text-nowrap"><?php echo $opportunitiesLang['published'] ?></th>
                            <th class="text-nowrap"><?php echo $opportunitiesLang['deadLine'] ?></th>
                            <th class="text-nowrap"><?php echo $opportunitiesLang['categories'] ?></th>
                            <th class="text-nowrap"><?php echo $opportunitiesLang['source'] ?></th>
                            <th class="text-nowrap"><?php echo $opportunitiesLang['action'] ?></th>
                        </tr>
                    </thead>
                    <tbody>
    
                        <?php $sql=$db->qSql("SELECT * FROM tenders where status=1");
                        $getData=$sql->fetchAll(PDO::FETCH_ASSOC);
    
                        foreach ($getData as $tenders) { ?>
                            <tr class="odd gradeX" height="40px" style="font-size: 14px!important;" id="secret<?php echo $tenders['id']; ?>">
                                <td width="30%"><?php echo $tenders['name']; ?></td>
                                <td><?php echo $tenders['buyer']; ?></td>
                                <td class="text-center"><?php echo $newformat ?></td>
                                <td class="text-center">
                              
                                </td>
                                <td><?php echo $tenders['tenderType'] ?></td>
                                <td><a href="<?php echo $tenders['link']; ?>" target="_blank"><?php echo $tenders['source']; ?></a></td>
                                <td>
                                    <button class="btn btn-danger btn-xs btn-block">Register</button>
                                    <button class="btn btn-secondary btn-xs btn-block rejectTender" id="<?php echo $tenders['id']; ?>" name="rejectTender">Reject</button>
                                </td>
                            </tr>
    
                        <?php } ?>
    
                    </tbody>
                </table>
    AJAX KODUM
    <script>
        $(document).ready(function () {
            $('.rejectTender').click(function (event) {      
                swal({
                    title: title,
                    text: Desc,
                    icon: 'error',
                    buttons: true,
                    dangerMode: true,
                }).then((result) => {
                    if (result) {
                        $.ajax({
                            type: 'POST',
                            url: '../../config/updateProcess.php',    
                            data: { id:id, rejectTender:rejectTender},
                            success: function (result) {                        
    
                                if($.trim(result) == "error") {
                                } else if(result == "ok") {
                                    sweetAlert(ok, okDesc, 'success').then($("#secret"+id).hide());
                                }
                            },
                        });
                    }
                });
            });
        });
    </script>
    [B][/B]
    Selamlar Hocam, ufak bir bilgim var sanırım çözmeye yeter anydesk ile bağlanıp bakabilir miyim?
  • 09-05-2022, 23:05:39
    #3
    socidev adlı üyeden alıntı: mesajı görüntüle
    Selamlar Hocam, ufak bir bilgim var sanırım çözmeye yeter anydesk ile bağlanıp bakabilir miyim?
    tabiki hocam pm atıyorum
  • 09-05-2022, 23:10:55
    #4
     $("#example1").DataTable({
            "stateSave": true,
        });
    bunu eklemeniz yeterli olacaktır datatable'a
  • 09-05-2022, 23:23:22
    #5
    cokcamedya adlı üyeden alıntı: mesajı görüntüle
     $("#example1").DataTable({
            "stateSave": true,
        });
    bunu eklemeniz yeterli olacaktır datatable'a
    bu sorunumu çözmedi fakat;
    @socidev; arkadaşım uzaktan bağlanarak yardımcı oldu.
    Emekleri için tekrardan teşekkür ederim.
  • 09-05-2022, 23:31:28
    #6
    Üyeliği durduruldu
    emrezsy adlı üyeden alıntı: mesajı görüntüle
    bu sorunumu çözmedi fakat;
    @socidev; arkadaşım uzaktan bağlanarak yardımcı oldu.
    Emekleri için tekrardan teşekkür ederim.
    Rica ederim. Benim için bir zevkti