0
codeigniterコントローラからjqueryデータテーブルを使ってデータテーブルを表示しています。私が知りたいのは、データテーブル内の値をコントローラに戻して、それらの値を使ってDBから新しいレコードを取得し、ページに再度ロードすることです。データテーブルからコードシニターにデータを返す
私の現在のコードは
私は、選択ボックスのいずれかに最小最大値を選択すると、今ではに送信されなければならない$(function(){
$('#tableChart').dataTable({
// -------Function for formatting the table data elements-------
"fnRowCallback": function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
$.each(aData, function (i, elem){
$('td:eq('+i+')', nRow).html('<b><font color="#40A913">'+aData[i]+'</font></b>');
})
return nRow;
},
"bAutoWidth": false,
"bProcessing": true,
"bLengthChange": false, // Remove the show list drop down button
"bInfo": false, // Remove info part under the table
"bFilter" : false, // Remove search box
"bDestroy": true, // Remove table & recreate table
"bServerSide": false,
"sAjaxSource": "<?php echo base_url(); ?>index.php/print_db_table/get_print_db_table/<?php echo $table_name; ?>",
});
});
<div class="container">
<div class="holderForTableChart">
<table width ="100%" cellpadding="5" cellspacing="0" class="display" id="tableChart">
<thead>
<tr id="tableHeadder" >
<?php
foreach($table_header as $item):
$header = $item->name;
echo '<th>'.$header.'</th>' ;
endforeach;
?>
</tr>
<tr>
<td></td>
<td>
<select id=""></select>
<select id=""></select>
</td>
<td>
<select id=""></select>
<select id=""></select>
</td>
<td>
<select id=""></select>
<select id=""></select>
</td>
<td>
<select id=""></select>
<select id=""></select>
</td>
</tr>
</thead>
<tbody>
<tr>
<td colspan="6" class="dataTables_empty">Loading data from server</td>
</tr>
</tbody>
</table>
</div>
</div>
です私はモデルにそれらを送信し、それらを収集し、ビューでそれらを再ロードすることができますコントローラ
すごいが、このように思える
は、私はウルの問題のためにfnServerData部にこのページを参照$ _POST [「min_max_value」]として、この分の最大値をつかむことができるようになりますうまく動かないかもしれません。ここで状況を更新してください。あとで努力していただきありがとうございます。 – swordfish
ちょっと、データがCIコントローラに返送されていないようです。テーブル – swordfish
奇妙なCIコントローラがデータを受信していないため、Firebugをインストールしてconsole.debug(data)を置くことができます。このdata.push({...})コードの直後 – Aman