AshishJoshi-asj / zfdatagrid

Automatically exported from code.google.com/p/zfdatagrid
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Filter search on referenced field in Grid #153

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. make a referenceMap in a class 

protected $_referenceMap = array(
  'User' => array(
    'columns' => 'userID',
    'refTableClass' => 'users',
    'refColumns' => 'name'
  ));

2. add Filter on field userID
3. type something and run Filter

What is the expected output? What do you see instead?
Rows filtered by the search pattern
SQL error

What version of the product are you using? On what operating system?
0.6alpha

Please provide any additional information below.
This is part of select statement variable. The rest is attached

  where Array [2]   
    0  (string:33) (addressbook.name LIKE '%Ana%')  
    1  (string:16) AND ( LIKE 'C%')    <<<<< no field at all

should be  

AND ( userID in (select id from users where name like 'C%'))

The whole var dump is attached.

Original issue reported on code.google.com by vlatko.b...@gmail.com on 11 Feb 2010 at 8:00

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Vlatko.

I think it's solved.

Please check.

Best Regards,
Bento Vilas Boas

Original comment by pao.fre...@gmail.com on 11 Feb 2010 at 11:41

GoogleCodeExporter commented 9 years ago
Hi Pao,

using ->addFilter('userID') I got still the same error:

SELECT `addressbook`.`id`, `addressbook`.`hDateTime`, `addressbook`.`name`, 
      `users`.`name` AS `userID`, `countries_1`.`name` AS `countryID` 
 FROM `addressbook`
 LEFT JOIN `users` ON users.id = addressbook.userID
 LEFT JOIN `countries` AS `countries_1` ON countries_1.id = addressbook.countryID
WHERE (name LIKE '%t%') 
-->> should be WHERE (users.name LIKE '%t%') 

Original comment by vlatko.b...@gmail.com on 12 Feb 2010 at 10:41

GoogleCodeExporter commented 9 years ago
Hi,

Can you please try again.

Revision 564+

Best Regards,
Bento Vilas Boas

Original comment by pao.fre...@gmail.com on 12 Feb 2010 at 12:03

GoogleCodeExporter commented 9 years ago
Hi Pao,

It is working. I tried on both referenced tables, and simultaneously, and it's
showing correct results.

Original comment by vlatko.b...@gmail.com on 12 Feb 2010 at 12:15

GoogleCodeExporter commented 9 years ago

Original comment by pao.fre...@gmail.com on 12 Feb 2010 at 2:17

GoogleCodeExporter commented 9 years ago

Original comment by pao.fre...@gmail.com on 12 Feb 2010 at 2:18

GoogleCodeExporter commented 9 years ago

Original comment by bento.vi...@gmail.com on 3 Mar 2010 at 4:56