From dc0a5bbe156a7bd9c9e8c2d6c46e354f8bf89efe Mon Sep 17 00:00:00 2001 From: Rodolfo Silva Date: Wed, 2 Jul 2014 16:32:47 -0300 Subject: [PATCH] Resolved problem #53 --- application/libraries/Datatables.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/libraries/Datatables.php b/application/libraries/Datatables.php index f955497..37449bb 100644 --- a/application/libraries/Datatables.php +++ b/application/libraries/Datatables.php @@ -64,6 +64,7 @@ public function select($columns, $backtick_protect = TRUE) foreach($this->explode(',', $columns) as $val) { $column = trim(preg_replace('/(.*)\s+as\s+(\w*)/i', '$2', $val)); + $column = preg_replace('/.*\.(.*)/i', '$1', $column); // get name after `.` $this->columns[] = $column; $this->select[$column] = trim(preg_replace('/(.*)\s+as\s+(\w*)/i', '$1', $val)); } @@ -263,12 +264,12 @@ private function get_paging() */ private function get_ordering() { - + $Data = $this->ci->input->post('columns'); if ($this->ci->input->post('order')) - foreach ($this->ci->input->post('order') as $key) + foreach ($this->ci->input->post('order') as $key) if($this->check_cType()) $this->ci->db->order_by($Data[$key['column']]['data'], $key['dir']); else