我有一個網站頁面的排序列和加載頁面點擊一排功能加載遊戲僅適用於具有有效的遊戲記錄錶行。表格標題表格行具有列標題而不是遊戲記錄。所以當我點擊一個表頭表格行時,該列會按照它應該排序,但是然後嘗試加載一個遊戲,但它不能。數據表在<a href="http://communitychessclub.com/examine.php" rel="nofollow">http://communitychessclub.com/examine.php</a></p> <p>問題沒有gamescore
$("#cccr").on("click", "tr", function() {
window.location.href = 'basic.php?game=' + $(this).attr('game');
這可以解決嗎?這是完整的腳本代碼:
$(document).ready(function() {
$('#cccr').DataTable({
"createdRow": function(row, data, index) {
$(row).attr('game', data.game);
},
"search": {
"search": "<?php echo ($_GET['player']); ?>"
},
"order": [
[0, "asc"]
],
"keepConditions": true,
"paging": true,
"deferRender": false,
"oSearch": {
"sSearch": "<?php echo ($_GET['player']); ?>"
},
"aaSorting": [],
"bPaginate": false,
"bLengthChange": true,
"bFilter": true,
"bSort": true,
"bInfo": true,
"sPaginationType": "numbers",
"responsive": true,
"bAutoWidth": true,
"autoWidth": true,
"stateSave": false,
"ajax": "assets/games.ajax",
"pageLength": 6,
"columns": [{
"data": "Date",
"width": "7rem",
}, {
"data": "Event"
}, {
"data": "ECO"
}, {
"data": "White"
}, {
"data": "WhiteElo"
}, {
"data": "Black"
}, {
"data": "BlackElo"
}, {
"data": "Result"
}, {
"data": "game",
visible: false
}]
});
$("#cccr").on("click", "tr", function() {
window.location.href = 'basic.php?game=' + $(this).attr('game');
});
});
簡單簡潔而完美! – verlager