Skip to content

Commit

Permalink
- fixed custom columns replaces
Browse files Browse the repository at this point in the history
  • Loading branch information
n1crack committed Apr 16, 2011
1 parent 8f9ec8b commit aac3c7b
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions application/libraries/Datatables.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,17 +346,14 @@ protected function produce_output($columns, $iTotal, $iFilteredTotal, $rResult,
$aaData[$row_key][] = $col_val;
}

if(isset($custom_columns) && is_array($custom_columns))
{
foreach($custom_columns as $cus_col_key => $cus_col_val)
{
if(isset($cus_col_val[1]) && is_array($cus_col_val[1]))
foreach($cus_col_val[1] as $cus_colr_key => $cus_colr_val)
$aaData[$row_key][] = str_ireplace('$' . ($cus_colr_key + 1), $aaData[$row_key][array_search($cus_colr_val, $columns)], $cus_col_val[0]);
else
$aaData[$row_key][] = $cus_col_val[0];
}
}
foreach($custom_columns as $cus_col_key => $cus_col_val)
{
if (isset($cus_col_val[1]) && is_array($cus_col_val[1])){
foreach($cus_col_val[1] as $cus_colr_key => $cus_colr_val)
$cus_col_val[0] = str_ireplace("$".($cus_colr_key+1),$aaData[$row_key][array_search($cus_colr_val, $columns)], $cus_col_val[0]) ;
$aaData[$row_key][] = $cus_col_val[0];
}else $aaData[$row_key][] = $cus_col_val[0];
}
}

foreach($columns as $col_key => $col_val)
Expand Down

0 comments on commit aac3c7b

Please sign in to comment.