Closed GoogleCodeExporter closed 9 years ago
Hi,
Bvb_Grid_Filters is only a helper for custom filters.
If you would like to disable the search in a particular field use this:
$grid->updateColumn('Field',array('search'=>false));
Best Regards,
Bento Vilas Boas
Original comment by pao.fre...@gmail.com
on 11 Feb 2010 at 12:28
Yes, it does work.
How come that $grid->setDefaultFilters(array ()) does not disable all filters?
Original comment by vlatko.b...@gmail.com
on 11 Feb 2010 at 12:35
Hi,
setDefaultFilters() is intended to set the default values for filters
$grid->setDefaultFilters(array('Name'=>'Portugal'));
On load, the grid will be filtered by Name containing Portugal.
Maybe the name should be setDefaultFiltersValues()
But I will change the Bvb_Grid_Filters behavior.
If used, all others fields not specified will be turn off.
Best Regards,
Bento Vilas Boas
Original comment by pao.fre...@gmail.com
on 11 Feb 2010 at 3:05
I vote for name change. :-)
Original comment by vlatko.b...@gmail.com
on 11 Feb 2010 at 3:14
Done.
Name changed from setDefaultFilters to setDefaultFiltersValues and behavior
when add
filters from Bvb_Grid_Filters also changed. It not specified, the field input
won't
be displayed.
Best Regards,
Bento Vilas Boas
Original comment by pao.fre...@gmail.com
on 11 Feb 2010 at 3:18
It works now, but I encountered another issue:
Mysqli prepare error: Column 'xname' in where clause is ambiguous
I created a complete file with all the info. As I figured out, the problem exist
because two tables have the same name (which are correctly referenced in field
list
part), but Filter does not follow that.
Below is part of Exception (rest in file):
SELECT `xaddressbook`.`id`, `xaddressbook`.`xname`, `xusers`.`id` AS `userID`
FROM `xaddressbook`\n LEFT JOIN `xusers` ON xusers.id = xaddressbook.userID
WHERE (xname LIKE '%Ana%') -- xname is not referenced with table name
LIMIT 15
Original comment by vlatko.b...@gmail.com
on 11 Feb 2010 at 4:40
Attachments:
Fixed
Original comment by pao.fre...@gmail.com
on 11 Feb 2010 at 6:36
Original comment by pao.fre...@gmail.com
on 11 Feb 2010 at 6:36
Original comment by pao.fre...@gmail.com
on 11 Feb 2010 at 6:36
Hi Pao,
It works, but I encountered the same a problem that might be useful in manual.
I added filter like this
->addFilter('name', array(
'distinct' => array(
'field' => 'name', 'name' => 'name',)))
and it didn't work, but when I added table name 'addressbook to field all works
->addFilter('name', array(
'distinct' => array(
'field' => 'addressbook.name', 'name' => 'name',)))
I do not think it is possible to automate this table name addition because one
might
want to filter for another field by the same name (e.g. 'countries.name').
Original comment by vlatko.b...@gmail.com
on 11 Feb 2010 at 7:11
Hi,
No need to prefix the table name. I know the field table based on the field
output.
Please updated tot the latest SVN revision (561+) and check if it work.
Best Regards,
Bento Vilas Boas
Original comment by pao.fre...@gmail.com
on 11 Feb 2010 at 11:16
Hi Pao,
No, it is still the same error. If I use
->addFilter('name') >> initial Grid is OK, but error below occures
->addFilter('addressbook.name') >> Filter is not displayed in Grid at all
Here is the Where part of select. I got in Data.php on line 2182:
where Array [1]
0 (string:21) (name LIKE '%Draki%')
And full select:
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 '%Ana%')
LIMIT 10
Original comment by vlatko.b...@gmail.com
on 12 Feb 2010 at 10:30
HI,
Please try again.
Revision 564+.
Best Regards,
Bento Vilas Boas
Original comment by pao.fre...@gmail.com
on 12 Feb 2010 at 12:04
Hi Pao,
Still the same.
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 '%Ana%') ******
Original comment by vlatko.b...@gmail.com
on 12 Feb 2010 at 12:20
I think it should be fine now.
please try again.
Revision 565
Best Regards,
Bento Vilas Boas
Original comment by pao.fre...@gmail.com
on 12 Feb 2010 at 12:50
Hi Pao,
It works. All field name problems are gone. :-))
Original comment by vlatko.b...@gmail.com
on 12 Feb 2010 at 2:14
Original comment by pao.fre...@gmail.com
on 12 Feb 2010 at 2:17
Original comment by pao.fre...@gmail.com
on 12 Feb 2010 at 2:17
Original comment by bento.vi...@gmail.com
on 3 Mar 2010 at 4:56
Original issue reported on code.google.com by
vlatko.b...@gmail.com
on 11 Feb 2010 at 12:11