Hey guys,
in the backend of SS3 we have the nice filter function to search for special dataobjects in the listview.
In the modeladmin I´ve used a code which load values in the filter inputfields:
public function getSearchContext() {
$currentUser = Member::currentUser()->FirstName;
$currentUser = trim($currentUser);
$context = parent::getSearchContext();
$context->getFields()->fieldByName('q[Member__FirstName]')->setValue($currentUser); //set current user name in inputfield 'Member'
return $context;
}
This works pretty fine. What I now wanna do is to start the filter function automatically without clicking the apply-filter-button.
If have tried to use a javascript to submit the button, but this has the result, that the page is reloading again, again and again.
Does anybody have an idea to fix this problem? Is there a nice php-function or something else?