|
Upgrade
How to Upgrade
0.7 to trunk (0.8)CacheCache 'use' param, has been renamed to 'enable' New $grid->setCache(array('enable' => true|false, 'instance' => $cache, 'tag' => 'grid'));OLD $grid->setCache(array('use' => array('form'=>false,'db'=>false), 'instance' => $cache, 'tag' => 'grid'));Callbacks/EventsCallbacks where removed in favor of events. A list of available events will be available soon. But for crud operations something like this can be done $grid->listenEvent('crud.before_update', $callback);Your callback will receive one arg, a Bvb_Grid_Event instance function My_Callback($event)
{
$params = $event->getParams();
$param = $event->getParam($param);
$name = $event->getName();
$object = $event->getObject();
}Full list for crud operations:
These names can change before version release Mass actionsThey have their own class now. Changes: OLD: $actions->setMassActions(array(array('url' => $grid->getUrl(),
'caption' => 'Remove (Nothing will happen)',
'confirm' => 'Are you sure?'),
array('url' => $grid->getUrl() . '/nothing/happens',
'caption' => 'Some other action',
'confirm' => 'Another confirmation message?')));
NEW: $actions = new Bvb_Grid_Mass_Actions();
$actions->setMassActions(array(array('url' => $grid->getUrl(),
'caption' => 'Remove (Nothing will happen)',
'confirm' => 'Are you sure?'),
array('url' => $grid->getUrl() . '/nothing/happens',
'caption' => 'Some other action',
'confirm' => 'Another confirmation message?')));
$grid->setMassActions($actions);06.5. to 0.7Defining grid columns - Until now when setting grid columns, extra columns where always there. From now on, when defining grid columns you must also specify any extra column you want to see. Use the column name. 0.6 to 0.6.5
0.5 to 0.6Factory PatternNow you don't have to instantiate the deploy class. Use this: $grid = Bvb_Grid::factory('table',$options = array(),$gridId = '');Uniformed fields callsWhenever you are, you must cell the field name by it's output and not by name. Tables prefixes are also over. If your raw query looks like this: SELECT id, username as name, age, status, online FROM users where id='1'; You must reference to the field username as name. If you are using joins and you have two fields with the same name on different tables you must give one of them an alias otherwise the first will be overwritten by the last. No direct AccessYou cannot set class attributes directly. You now must use the set() method. Instead of $grid->cache = array(); You now have to do $grid->setCache(array()); CRUD OperationsCRUD operations now use Zend_Form to render the form. No more custom forms. Please refer to this page for more information Data SourcesZFDatagrid now uses a interface to build the grid, so no more calls like this: $grid->setDataFromArray(); $grid->setDataFromXml(); you must now use $grid->setSource(new Bvb_Grid_Source_`*`); Check this page for detailed information Changes in the query() method. $grid->query($select);//Can be used only for Zend_Db_Select and Zend_Db_Table_Abstract Sources Renamed
|