Open walliby opened 9 years ago
This has not been implemented and frankly I have not been developing on this much. It needs to be ported to Cake3 since that is where my focus is now and the cake2 version needs to be forked by someone who will take over development.
On Mon, Mar 2, 2015 at 1:41 PM, Joshua Wallace notifications@github.com wrote:
Multi column sorting does not seem to be working. Looks like maybe this wasnt coded yet as I can only find reference to iSortCol_0 in the component. Can you confirm I'm not just missing something on the js end? Thanks
— Reply to this email directly or view it on GitHub https://github.com/cnizzdotcom/cakephp-datatable/issues/28.
Gotcha. I don't use git at work though we may switch in the future. For now, here's the code I used for multi column ordering...
$sorting_cols = $this->controller->request->query['iSortingCols'];
for($col = 0; $col < $sorting_cols; $col++) {
if( !empty($fields) && isset($this->controller->request->query['iSortCol_' . $col]) ){
$direction = $this->controller->request->query['sSortDir_' . $col] === 'asc' ? 'asc' : 'desc';
$orderBy .= $fields[ $this->controller->request->query['iSortCol_' . $col] ].' '.$direction.', ';
}
}
Hi walliby,
I tried the code but it seems not work in my app.
Multi column sorting does not seem to be working. Looks like maybe this wasnt coded yet as I can only find reference to iSortCol_0 in the component. Can you confirm I'm not just missing something on the js end? Thanks