Your problem is, that the current attribute value 1 is not contained in the list of available options. Besides that, your code looks a little unconventional. I can’t understand what you try with ‘termSymbols[1]’. This should be a regular attribute name (e.g. ‘gender’)
I’m sorry I just referred example and changed the context of some part so thats why it can be hard to understand.
So in fact there are no options like male and female, but options like:
1.iquals ( = )
2.contains
starts with
4.ends
And the number of the dropDownList elements will be between 0 - 10, depending what does javascript determines.
So, i tried to get all termSymbols in array with length 10.
and later i would be able to call like termSymbols[7] and it would return "starts with" or something.
And dropdownlist would be generated in loop.
thats why im not able to make variable gender, or in this sitution termSymbol, becouse
I would need lot of them, like $the_fifth_gender = $genders[4];
This hole component are maint to offer filters to make database queries in browser , like look for users with email that starts with "a" and the second statement is that users have a surname which is igual than "alfonso".
public function initalize()
{
$this->termSymbols = array();
$this->termSymbols[1] = "test";
}
I tryed to put this code in an existing model, and in the view of that model I used your dropdown code and it’s displaying without error… haven’t tried to access the data…