Skip to content
This repository has been archived by the owner on Dec 9, 2022. It is now read-only.

Multi column sorting #28

Open
walliby opened this issue Mar 2, 2015 · 3 comments
Open

Multi column sorting #28

walliby opened this issue Mar 2, 2015 · 3 comments

Comments

@walliby
Copy link

walliby commented Mar 2, 2015

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

@cnizzardini
Copy link
Owner

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 [email protected]
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
#28.

@walliby
Copy link
Author

walliby commented Mar 3, 2015

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.', ';
        }

    }

@spkljl
Copy link

spkljl commented May 8, 2015

Hi walliby,

I tried the code but it seems not work in my app.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants