Php 在点燃的数据表中搜索和排序不起作用
我在codeigniter应用程序中使用Ignited数据表。除了搜索和排序之外,一切都在工作。我的代码如下: 控制器页面:Php 在点燃的数据表中搜索和排序不起作用,php,codeigniter,sorting,search,datatables,Php,Codeigniter,Sorting,Search,Datatables,我在codeigniter应用程序中使用Ignited数据表。除了搜索和排序之外,一切都在工作。我的代码如下: 控制器页面: public function datatable() { $this->datatables->select(" insight_project.projectName projectName, insight_project_module.moduleName modu
public function datatable()
{
$this->datatables->select("
insight_project.projectName projectName,
insight_project_module.moduleName moduleName,
insight_project_submodule.subModuleName issueName,
insight_project_submodule.estimatedTime estimatedTime,
insight_worksheet.spentTime,
insight_activity_list.name activityName,
insight_status.name statusName,
insight_worksheet.completedPercentage,
insight_worksheet.updatedById,
insight_worksheet.activity worksheetFillUpDate,
insight_worksheet.projectId workingDate,
insight_worksheet.reason,
insight_worksheet.worksheet_status
")
->from("insight_worksheet")
->join("insight_project_module","project_module.id=worksheet.moduleId","left")
->join("insight_project","project.id=worksheet.projectId","left")
->join("insight_project_submodule","project_submodule.id=worksheet.submoduleId","left")
->join("insight_activity_list","activity_list.id=worksheet.activity","left")
->join("insight_status","status.id=worksheet.status","left");
echo $this->datatables->generate();
}
在查看页面中,datatables插件相关代码就在那里。
我已经包括了jquery库文件和jquery.dataTables.min.js
<script type="text/javascript">
$(document).ready(function () {
var oTable = $('#big_table').dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": '<?php echo site_url() ?>/worksheet/datatable',
"sDom": '<"H"Tlpf>rt<"F"ip>',
"aoColumns": [
{"bSearchable": true,"bSortable": true},
{"bSearchable": true,"bSortable": true},
{"bSearchable": true,"bSortable": true},
{"bSearchable": true,"bSortable": true},
{"bSearchable": true,"bSortable": true},
{"bSearchable": true,"bSortable": true},
{"bSearchable": true,"bSortable": true},
{"bSearchable": true,"bSortable": true},
{"bSearchable": true,"bSortable": true},
{"bSearchable": true,"bSortable": true},
{"bSearchable": true,"bSortable": true},
{"bSearchable": true,"bSortable": true},
{"bSearchable": true,"bSortable": true}
],
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"iDisplayStart ": 20,
"oLanguage": {
"sProcessing":
"<img
src='<?php echo base_url(); ?>Assets/images/ajax-loader_dark.gif'
alt='processing_srimanta'>"
},
"fnInitComplete": function () {
// oTable.fnAdjustColumnSizing();
},
'fnServerData': function (sSource, aoData, fnCallback) {
aoData.push({
name: '<?php echo $this->security->get_csrf_token_name(); ?>',
value: '<?php echo $this->security->get_csrf_hash(); ?>'});
$.ajax
({
'dataType': 'json',
'type': 'POST',
'url': sSource,
'data': aoData,
'success': fnCallback
});
}
});
});
</script>
<?php echo $this->table->generate(); ?>
$(文档).ready(函数(){
var oTable=$('big#u table')。数据表({
“bProcessing”:正确,
“bServerSide”:正确,
“sAjaxSource”:“/worksheet/datatable”,
“sDom”:“rt”,
“aoColumns”:[
{“BSearcable”:true,“bSortable”:true},
{“BSearcable”:true,“bSortable”:true},
{“BSearcable”:true,“bSortable”:true},
{“BSearcable”:true,“bSortable”:true},
{“BSearcable”:true,“bSortable”:true},
{“BSearcable”:true,“bSortable”:true},
{“BSearcable”:true,“bSortable”:true},
{“BSearcable”:true,“bSortable”:true},
{“BSearcable”:true,“bSortable”:true},
{“BSearcable”:true,“bSortable”:true},
{“BSearcable”:true,“bSortable”:true},
{“BSearcable”:true,“bSortable”:true},
{“BSearcable”:true,“bSortable”:true}
],
“bJQueryUI”:没错,
“sPaginationType”:“完整编号”,
“iDisplayStart”:20,
“语言”:{
“数据处理”:
“Assets/images/ajax-loader_dark.gif”
alt='processing'>
},
“fnInitComplete”:函数(){
//可旋转。fn调整柱尺寸();
},
“fnServerData”:函数(sSource、aoData、fnServerData回调){
aoData.push({
名称:“”,
值:'});
$.ajax
({
“数据类型”:“json”,
'type':'POST',
“url”:sSource,
“数据”:aoData,
“成功”:fn回调
});
}
});
});
但搜索和列排序不起作用。
请让我知道我的问题是什么。
提前感谢。请删除
bServerSide
初始化选项,查看排序和搜索是否有效。完成。问题是列别名,如果我删除别名,它工作正常。但是如果可能的话,请告诉我列名。