PDA

View Full Version : Grid Filter Sort



catmd2b
30 Sep 2008, 6:02 AM
I've searched the forums and made my own adjustments, but I haven't discovered why the Grid Filter Sort does not work (not even so in the example). Could someone please tell me why?

Thank you!

mjlecomte
30 Sep 2008, 6:06 AM
You'd be better off posting your question for the extension in the thread for that extension. There are several for filters so I don't even know for sure which one you're talking about.

Maybe you could even post a link to the example you say doesn't work.

catmd2b
30 Sep 2008, 6:22 AM
The question pertains to the Grid Filtering Example : http://extjs.com/deploy/dev/examples/grid-filtering/grid-filter.html. There was a question posed in the grid filter thread, but it went unanswered.

mjlecomte
30 Sep 2008, 7:13 AM
If you inspect the post in firebug, it's only sending to the server to sort ASC. I recall some bug being reported in the past about this but didn't find it.

You could try the example in my signature if you like. On my local version of it, sorting is working and I have that extension wired into it.

winzent
12 Nov 2008, 8:36 AM
I've searched the forums and made my own adjustments, but I haven't discovered why the Grid Filter Sort does not work (not even so in the example). Could someone please tell me why?

Thank you!

You're right, I found the same problem here.

I tracked the SQL query log and I believe it's small error in the php filter file : grid-filter.php

Look at the code here:


$sort = ($_REQUEST["sort"] == null)? "" : $_REQUEST["sort"];
$dir = ($_REQUEST["dir"] == "desc")? "DESC" : "";
$filter = $_REQUEST["filter"];I changed
$dir = ($_REQUEST["dir"] == "desc")? "DESC" : ""; into
$dir = ($_REQUEST["dir"] == "DESC")? "DESC" : "";
and then everything goes well!

The direction property is case-sensitive here.

catmd2b
12 Nov 2008, 9:21 AM
I tried that fix, but unfortunately it did not work for me. I'm using an Oracle DB backend (not by choice either). However, what does seem to work is simply:


$dir = $_REQUEST["dir"];

Go figure. :)

Thanks and have a nice day.
Christina