0
我有一个数据表显示使用来自codeigniter控制器的jquery数据表。我想知道的是,如何将数据表中的值从数据表发送回控制器,并使用这些值从数据库检索新记录,然后再次将它们加载到页面中。从数据表发回数据到codeigniter
我当前的代码是
$(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>
现在,当我选择的选择框任何一个最小最大值必须被送到控制器从哪里我可以发送他们到一个模型和收集他们并重新加载他们在视图
哇看起来这可能会工作,虐待尝试,并在此更新状态,在此先感谢您的努力 – swordfish 2011-06-07 05:50:09
嘿,似乎数据没有被发回到CI控制器,即使选择后,事情只是加载相同表 – swordfish 2011-06-07 07:20:08
这是奇怪的CI控制器没有收到数据,你可以安装萤火虫和放置console.debug(数据);在这之后data.push({...})代码 – Aman 2011-06-07 17:01:41