table_alias in filters

Discuss everything related to ApPHP DataGrid class. All versions. Any questions related to the ApPHP DataGrid developing or using should be posted to this forum.
Please, check out Knowledge Base first before you post a question.

Moderator: alexandrleonenko

Forum rules
Posts are to be made in the relevant forum. Users are asked to read the forum descriptions before posting.
cooperlegend
Newbie
Newbie
Posts: 8
Joined: Jan 7th, '14, 16:09

table_alias in filters

Postby cooperlegend » Feb 8th, '17, 16:10

Hi

I am trying to filter using table_alias

Code: Select all

         "Home Team"=>array("type"=>"enum", "table"=>"Teams", "table_alias" => "HomeTeams", "field"=>"name", "filter_condition"=>"", "show_operator"=>"false", "default_operator"=>"=", "case_sensitive"=>"false", "comparison_type"=>"string|numeric|binary", "width"=>"", "on_js_event"=>"", "default"=>""),
         "Away Team"=>array("type"=>"enum", "table"=>"Teams", "table_alias" => "AwayTeams", "field"=>"name", "filter_condition"=>"", "show_operator"=>"false", "default_operator"=>"=", "case_sensitive"=>"false", "comparison_type"=>"string|numeric|binary", "width"=>"", "on_js_event"=>"", "default"=>""),


But when I try this it make home team the same as away time, any ideas?

administrator
Site Admin
Site Admin
Posts: 6003
Joined: Jan 7th, '09, 23:18
Contact:

Re: table_alias in filters

Postby administrator » Feb 8th, '17, 19:07

Can you explain please in more details, what exactly happens?

cooperlegend
Newbie
Newbie
Posts: 8
Joined: Jan 7th, '14, 16:09

Re: table_alias in filters

Postby cooperlegend » Feb 9th, '17, 00:05

If I just use one of the filters it will either successfully filter on the home team or the away team (which I have used)

But if I use both filters then the home team selection does nothing and cant be selected, the away team filter works but actually filters on the home team and sets both drop downs to the same selection...

cooperlegend
Newbie
Newbie
Posts: 8
Joined: Jan 7th, '14, 16:09

Re: table_alias in filters

Postby cooperlegend » Feb 15th, '17, 12:17

Any advise ?

administrator
Site Admin
Site Admin
Posts: 6003
Joined: Jan 7th, '09, 23:18
Contact:

Re: table_alias in filters

Postby administrator » Feb 16th, '17, 07:44

Turn on debug and check what you see.
How the SQL was built?


Return to “ApPHP DataGrid”