Hello,
I have the following datagrid filter that works perfectly:-
class TransactionAdmin
{
...
$datagridMapper
->add('user')
->add('status')
;
...
}
Transaction has a ManyToOne association with User entity.
So I get a nice drop down box with a list of all the user which I can select from.
But the problem is that while testing the app, we'll load hundreds of thousands of users in the database and obviously loading a select box with >100,000 options is not a feasible option.
How can I customize the query such that the administrator can enter the username in an input box and the query runs with a "LIKE" condition.
I have tried -
$datagridMapper
->add('offer', 'doctrine_orm_string', array(), null, array())
It works if I select Filter Option - 'is equal to' and input the correct user_id in the field.
I have the following two requirements:-
1. How can I set the FilterOptions to only display 'is equal to' option instead of 'contains', 'does not contain', 'is equal to'
2. How can I use 'username' instead of the 'user_id' for the filter query?
Thanks,
Amit