nextras / datagrid

Nextras Datagrid component for Nette Framework.
http://nextras.org/datagrid
MIT License
70 stars 39 forks source link

Fixed issue #41 #46

Closed racinmat closed 9 years ago

racinmat commented 9 years ago

Thanks to onAttached event, you can now put your custom variables to datagrid template and register macros to datagrid template without need to connect datagrid to component tree in constructor, which breaked pagination.

Adding your own macros and other variables looks like this:

    $grid = new Datagrid();
    $grid->onAttached[] = function(Datagrid $datagrid) {
        $datagrid->template->addFilter('myCoolMacro', function ($s) {
            return myCoolMacro($s);
        });
        $datagrid->template->myVariable = $this->myVariable;
    };
hrach commented 9 years ago

thanks a lot! I changed it to render event, it refelects more the reason.