Closed GoogleCodeExporter closed 9 years ago
Hi,
$grid->listenEvent('grid.init_deploy', array($this, 'addAutoCompleteToFields'));
Should do the trick
Best Regards,
Bento Vilas Boas
Original comment by bento.vi...@gmail.com
on 30 Sep 2011 at 10:13
Hi,
That works better. But it's seems the url is wrong.
This is my addAutoCompleteToFields function :
public function addAutoCompleteToFields(Bvb_Grid_Event $event)
{
$subject = $event->getSubject();
$script = "$(document).ready(function() {";
foreach ($subject->getVisibleFields() as $name) {
$script .= "$(\"input#filter_$name\").autocomplete({focus: function(event, ui) "
. "{document.getElementById('filter_$name').value = ui.item.value },"
. " source: '{$subject->getAutoCompleteUrlForFilter($name)}'});\n";
}
$script .= "});";
$subject->getView()->headScript()->appendScript($script);
}
Thanks for your support, and sorry for my bad english :x
Original comment by p...@yujia.fr
on 1 Oct 2011 at 5:49
Hi,
What is the url generated?
Best Regards,
Bento Vilas Boas
Original comment by bento.vi...@gmail.com
on 1 Oct 2011 at 6:10
In my admin module, content controller, and index action, when I type something
in the field 'title', the url generated is :
http://yujia.fr/admin/content/index/_gridId/index_content_admin/field/titre/_opt
ion/autocomplete?term=U
Best Regards,
Pierre Jolly
Original comment by p...@yujia.fr
on 2 Oct 2011 at 10:40
Hi,
And the correct URL should be:
http://yujia.fr/fr/admin/content/index/_gridId/index_content_admin/field/titre/_
option/autocomplete?term=U ?
Try setting the route name
$grid->setRoutename('myRoute');
Best Regards,
Bento Vilas Boas
Original comment by bento.vi...@gmail.com
on 2 Oct 2011 at 5:26
Original issue reported on code.google.com by
p...@yujia.fr
on 30 Sep 2011 at 6:37