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]