Koenig, если есть, он выводит все записи и стрелочками мы их перемещаем. Перемещение делаем с помощью Jquery. Вроде не сложно делать.
$(document).on('click', '.move_list', function () {
$.ajax({
type: "GET",
url: $(this).attr('href'),
dataType: 'html',
data: '',
success: function (data) {
$('#list').html($(data).find('#list').html());
}
});
});
Думаю всё понятно..
Всем спасибо. Будем разбирать)
<tbody id="categoryRecords">
<tr id="6"> <td> 6</td><td>National Event Days</td><td class="actions-wide"> <a class="waves-effect waves-light btn blue edit-button"><i class="mdi mdi-pencil left"></i>Edit</a>
<a class="waves-effect waves-light btn red delete-button"><i class="mdi mdi-delete left"></i>Delete</a> </td><td><a href="/index.php?up=8&to=7&i=0"><img src="img/up.png" title="up"></a> <a href="/index.php?down=8&to=9&i=0"><img src="img/down.png" title="down"></a></td></tr> <tr id="8"> <td> 8</td><td>Soccer - Rep of Ire Football</td><td class="actions-wide"> <a class="waves-effect waves-light btn blue edit-button"><i class="mdi mdi-pencil left"></i>Edit</a>
<a class="waves-effect waves-light btn red delete-button"><i class="mdi mdi-delete left"></i>Delete</a> </td><td><a href="/index.php?up=9&to=8&i=1"><img src="img/up.png" title="up"></a> <a href="/index.php?down=9&to=10&i=1"><img src="img/down.png" title="down"></a></td></tr> <tr id="9"> <td> 9</td><td>Soccer - Champions League</td><td class="actions-wide"> <a class="waves-effect waves-light btn blue edit-button"><i class="mdi mdi-pencil left"></i>Edit</a>
<a class="waves-effect waves-light btn red delete-button"><i class="mdi mdi-delete left"></i>Delete</a> </td><td><a href="/index.php?up=10&to=9&i=2"><img src="img/up.png" title="up"></a> <a href="/index.php?down=10&to=11&i=2"><img src="img/down.png" title="down"></a></td></tr> <tr id="10"> <td> 10</td><td>Soccer - Europa League</td><td class="actions-wide"> <a class="waves-effect waves-light btn blue edit-button"><i class="mdi mdi-pencil left"></i>Edit</a>
<a class="waves-effect waves-light btn red delete-button"><i class="mdi mdi-delete left"></i>Delete</a> </td><td><a href="/index.php?up=11&to=10&i=3"><img src="img/up.png" title="up"></a> <a href="/index.php?down=11&to=12&i=3"><img src="img/down.png" title="down"></a></td></tr> <tr id="12"> <td> 12</td><td>Soccer - Euro 2016 Finals</td><td class="actions-wide"> <a class="waves-effect waves-light btn blue edit-button"><i class="mdi mdi-pencil left"></i>Edit</a>
<a class="waves-effect waves-light btn red delete-button"><i class="mdi mdi-delete left"></i>Delete</a> </td><td><a href="/index.php?up=12&to=11&i=4"><img src="img/up.png" title="up"></a> <a href="/index.php?down=12&to=13&i=4"><img src="img/down.png" title="down"></a></td></tr> <tr id="13"> <td> 13</td><td>World Cup Qualifiers 2018</td><td class="actions-wide"> <a class="waves-effect waves-light btn blue edit-button"><i class="mdi mdi-pencil left"></i>Edit</a>
<a class="waves-effect waves-light btn red delete-button"><i class="mdi mdi-delete left"></i>Delete</a> </td><td><a href="/index.php?up=13&to=12&i=5"><img src="img/up.png" title="up"></a> <a href="/index.php?down=13&to=14&i=5"><img src="img/down.png" title="down"></a></td></tr> <tr id="14"> <td> 14</td><td>Rugby - Pro 12 Irish teams</td><td class="actions-wide"> <a class="waves-effect waves-light btn blue edit-button"><i class="mdi mdi-pencil left"></i>Edit</a>
<a class="waves-effect waves-light btn red delete-button"><i class="mdi mdi-delete left"></i>Delete</a> </td><td><a href="/index.php?up=14&to=13&i=6"><img src="img/up.png" title="up"></a> <a href="/index.php?down=14&to=15&i=6"><img src="img/down.png" title="down"></a></td></tr> <tr id="15"> <td> 15</td><td>Rugby - 6 Nations</td><td class="actions-wide"> <a class="waves-effect waves-light btn blue edit-button"><i class="mdi mdi-pencil left"></i>Edit</a>
<a class="waves-effect waves-light btn red delete-button"><i class="mdi mdi-delete left"></i>Delete</a> </td><td><a href="/index.php?up=15&to=14&i=7"><img src="img/up.png" title="up"></a> <a href="/index.php?down=15&to=16&i=7"><img src="img/down.png" title="down"></a></td></tr> <tr id="16"> <td> 16</td><td>Rugby - World Cup</td><td class="actions-wide"> <a class="waves-effect waves-light btn blue edit-button"><i class="mdi mdi-pencil left"></i>Edit</a>
<a class="waves-effect waves-light btn red delete-button"><i class="mdi mdi-delete left"></i>Delete</a> <td><a href="/index.php?up=36&to=35&i=29"><img src="img/up.png" title="up"></a> <a href="/index.php?down=36&to=37&i=29"><img src="img/down.png" title="down"></a></td></tr> </tbody>
на примере этого html кода можете написать js для перемещения ?
naster, Ссылкам для перемещения строк добавь класс move_str
$(document).on('click', '.move_str', function (event) {
event.preventDefault();
$.ajax({
type: "GET",
url: $(this).attr('href'),
dataType: 'html',
data: '',
success: function (data) {
$('#categoryRecords').html($(data).find('#categoryRecords').html());
}
});
});
Добавил, но нечего не происходит