Cgridview Seach By Post Method

Hi

I have a comblex CGridview and I would like the filter to search (ASC,DESC) and sort by POST method instead of GET

How could I do that ?

Thanks

Try to read this:

Hi Fabrizio

According to this link there in no (easy) way to do that

Qianqxue (the Leader of Yii framework) said for this issue

In my issue I have 15 columns but when I reduce the columns (about 8-9) everything work ok.

Note the problem occurs when set a search value in one column and click sort the column (simultaneously). After of that anything stop works (search or sort even seperately)

I try to sort the column’s name or alias and I will test it, thanks

If someone has any suggest for that please post!

Have a look at your browser’s developer tools; specifically the network section. Make sure the URL that’s being generated is correct. I’ve encountered issues where the javascript starts to append duplicate parameters with different values, which can quickly exhaust the capacity of a URL string.

Hi Keith

I have already check that and I observed the url has double slash (//)

The url was not correct and I confirmed that by new tab in browser (with all parameters)

I dont remember anything else at this moment but is very strange to works fine with fewer columns (!?)

When I will go to home I will give you more information, thanks for your advice :)

Note: I have activated urlManager in main config file.

I think the problem is the length of GET query.

when remove few columns (I tested many combinations) everything seem work fine.

Also the name of my model has 20 letter (may conduce to the problem)

when the url-query become over of 500 bytes then the request crash

on chrome the message is "no data received’

and on firefox ‘The connection was reset’ (with status=aborted in firebug)

the url seems like that


localhost/myapplication/index.php/controller/action/ajax/the-name-of-grid/

ThenameofModel%5The_name_of_column1%5D/value_search_col1/

ThenameofModel%The_name_of_column2%5D/value_search_col2/

.... repeating the same code for other 10 columns ...

ThenameofModel_sort/The_name_of_column_desc?ajax=the-name-of-grid

If ther is no easy solution for that, how can sort (alias) the column for cgridview filter?

Please let someone help :)

Thanks

I’ll try to subclass CGridView (js,php) trying to figure out how much work there is to do to support sending via $ _POST for your needs

Has anyone else any suggestion ?

Otherwise you could alias every field as only a letter and number.

Example:

field1 = c1

field2 = c2

field3 = c3

So you reduce at max field name length.

Hi Fabrizio!

Do you mean to short all model and column names or: Is there a way to set aliases for each attribute without touching the name-fields ?

Thanks!