omusico / zfdatagrid

Automatically exported from code.google.com/p/zfdatagrid
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

r1836 breaks all other deploy classes #725

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
* line 2778 in Grid.php 
http://code.google.com/p/zfdatagrid/source/browse/trunk/library/Bvb/Grid.php
* why should Grid class know about some special settings used internaly only by 
Table deploy class ?
* it breaks all other deploy classes, becase no one of them sets _willShow
* I fixed in r1841
        if ( !$this->_deployNeedsData() ) {
            $result = array();
            $resultCount = 0;
        } else {
            $result = $this->getSource()->execute();
            $resultCount = $this->getSource()->getTotalRecords();
        }
* what should be done more:
** the $_willShow should be moved to Table
** willShow() should be moved to Table and renamed to getWillShow()

Bvb was designed from begin to be independent from deploy classes, 
unfortunately already from begin there are areas which are not independend 
(like formaters, mass actions, filters) and unfortunately we did not made any 
progress to solve this.

Original issue reported on code.google.com by martin.m...@gmail.com on 18 Jul 2011 at 12:16

GoogleCodeExporter commented 9 years ago

Original comment by bento.vi...@gmail.com on 18 Jul 2011 at 8:19

GoogleCodeExporter commented 9 years ago
Hi,

Thanks for the fix.

About formatters, mass actions and filters.

Formatters format content such as date, currency, and I think this is a core 
feature that should be used by all deploy classes.

The same happens with mass actions. this feature can also be implemented by 
other deploy classes. At this moment it's not present in any other, but that 
can be integrated with jqgrid, or dojo or any other js data grid.

Filters are a more "complex" situation. Suppose I have a custom filter for 
tables (like number range or date range) when exporting data to xml I need that 
filter loaded so the filtering expression can be applied to data source. 

Best Regards,
Bento Vilas Boas

Original comment by bento.vi...@gmail.com on 20 Jul 2011 at 5:33

GoogleCodeExporter commented 9 years ago
Each of this functionalities are quite complicated. And to implement them 
proper needs planning of minimal functionality and future possible extensions.

* ZF proposal is a good way to do it
* or at least discussion on phone, as I proposed to you more times, would be 
benefical

Let me start with formatters.

Formatters
----------

Let's take jqgrid and export to excel (done with 
http://www.codeplex.com/PHPExcel) as an example. 
Booth deploy targets support own way to format values like numbers and dates. 
The formatter definition should be independent of the deploy class as much as 
possible. It should be exception to use deploy dependend formatter.

Date formatter for jqgrid needs to modify column definition. Date formatter for 
excel needs to modify rendering of cell. Date formatter for html table needs to 
modify value.

* A good option seams to be to load formatter classes depending on deploy grid 
class (Bvb_Grid_Formatter_<deployClass>_Date). 
* More hooks in Bvb_Grid_Formatter_FormatterInterface are necessery to give 
formatter the possibility to influence grid in more ways then only to change 
value. 
* possibility to map custom formatters per grid and per project/request

Let's go even further, that the formatter should work not only on whole 
columns, but even on cells. There are multiple possibile implementations:
* support only for some data sources, like array
* register formatter with some detection pattern to be executed by grid on 
value (example of data: "{important}{date}2012-1-1")

Original comment by martin.m...@gmail.com on 20 Jul 2011 at 9:45