Skip to content

Commit

Permalink
Merge pull request #58 from RodolfoSilva/master
Browse files Browse the repository at this point in the history
Resolved problem #53
  • Loading branch information
cryogenix committed Nov 4, 2014
2 parents 934f617 + dc0a5bb commit c92b48d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions application/libraries/Datatables.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,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));
}
Expand Down Expand Up @@ -279,12 +280,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
Expand Down

0 comments on commit c92b48d

Please sign in to comment.