octobercms/october — pull request #508 by Flynsarmy (2014-08-01 05:40:33+00:00)
Title: Add widget.beforeBindToController event

There is currently no way to bind to widgets created by the `FormController` on *create* and *update* pages. This patch allows the following in your controller:

```php
public function __construct()
{
parent::__construct();

BackendMenu::setContext('My.Plugin', 'plugin', 'page');

Event::listen('widget.beforeBindToController', function($widget) {
if ( get_class($widget) == 'Backend\FormWidgets\DataGrid' )
{
$widget->getGrid()->bindEvent('grid.dataChanged', function($changes) {
$this->grid_dataChanged($changes);
});
}
});
}
```