I have tables: Team and Worker. Any worker can be assigned to a Team. So at the Workers Manager I want to search Workers also by Team name.
I got the column etc. but when I type part of team name - search starts but the written text dissappears and search doesn’t care about the field. I checked the AJAX call with Firebug and there is a field called teamName (I added public field to my Worker model class). But when I print_r criteria in my search method - there is no condition.
How is that possible? How can I perform the searching by related field?
It does work, thanks. I just wanted to do it the way the guide provide - so I was surprised it is not working (altough people say it does).
One question @le_top - I noticed that it’s working only with default search method. Is it possible to define for example relatedSearch() method and do the search there?
The other thing - is it possible to pass constant ‘NOT LIKE’ parameter to the search programmatically?
If you want to add a constant ‘NOT LIKE’ comparison on a relation with the RelatedSearchBehavior you could define a specific related attribtute for that and set the value of the attribute to “<>SEARCH_TEXT”.
How do i search jarmu.rendszam field in Jqcalendar model? It possible? ex. group by?
Manual sql query: select * from jqcalendar left join foglaltjarmu on foglaltjarmu.FuvarID = jqcalendar.Id left join Flotta on Flotta.id = foglaltjarmu.jarmuID where Flotta.rendszam = ‘HOS-108’ group by …
This does not work for me.
public function search()
{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria=new CDbCriteria;
$criteria->with = array('jarmuvek');
$criteria->compare('jarmu.rendszam',$this->rendszam);