I haven't found a way yet to customize what items are shown in the "list" view. To be a little bit more specific : by default all the records in a database table are selected and displayed, I want to be able to tweak a little the database select in order to select only a subset of items from the table.
Asked
Active
Viewed 1,301 times
3 Answers
5
config:
list:
table_method: getForAdminList
Then, in a related model table class you can define your conditions to filter records:
public function getForAdminList()
{
$q = $this->createQuery('a')
->where('a.id > ?', 100);
return $q;
}
Notice that you have to return the query, not a collection of records.

Dziamid
- 11,225
- 12
- 69
- 104
0
Typically you wouldn't modify the DB call, but would instead change what is shown by editing the generator.yml file.
The part you should be interested in is
config:
list:
display: [fields, to, display]

Blair McMillan
- 5,299
- 2
- 25
- 45
-
I cannot use that part cause I'm not interested in filtering the fields but in filtering the records that are displayed. – Emerick Mar 03 '11 at 13:56
-
what about admin filters? if i want to generate custom filering table? – JackLeo Apr 06 '11 at 11:13
0
In /backend/modules/*module_name*/actions/action.class.php you can override the default admin methods of that module (like in frontend). If you want to filter all querys you can override the getFilters() method and add the default param like:
class firmaActions extends autoFirmaActions
{
protected function getFilters(){
$filters = parent::getFilters();
$filters['level_id'] = '3';
return $filters;
}
}
If you want to take a look of autoModuleActions you can find it in cache/backend/modules/autoModule/actions

Pabloks
- 1,484
- 1
- 14
- 15