I need to filter a CGridView, in typical admin page, through a date field with a range from-to.
I’ve found two useful articles about that, but…
The method descripted in this article runs correctly, but after applied the filter, if I use the grid by going in following pages or changing order of data, the range filter is deactivated. More, I would like to put the filter in the predefined "advanced search" box, but it runs only outside of that.
This one seems to be more sofisticated (for me) and I’m not sure to understand the problem. After setting the dates in the CJuiDatePicker, when clicking the confirm button it display an error:
htmlspecialchars() expects parameter 1 to be string, array given C:\xampp\htdocs\yii\framework\web\helpers\CHtml.php(98) ..... CBaseController->widget("zii.widgets.grid.CGridView", array... C:\xampp\htdocs\scadenzario\protected\views\scadenza\admin.php(157)
It seems depending from the "attribute" property of CJuiDatePicker that uses square brackets to define tha range as an array:
If I modify the “attribute” property, setting it with a string representing model variables, the error disappear. But the filter doesn’t run!
Can someone help me? thanks