Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r1836 breaks all other deploy classes #3

Open
imonteiro opened this issue Jan 18, 2013 · 2 comments
Open

r1836 breaks all other deploy classes #3

imonteiro opened this issue Jan 18, 2013 · 2 comments

Comments

@imonteiro
Copy link
Member

Original author: martin.m...@gmail.com (July 18, 2011 12:16:38)

  • 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: http://code.google.com/p/zfdatagrid/issues/detail?id=725

@imonteiro
Copy link
Member Author

From bento.vi...@gmail.com on July 20, 2011 05:33:00
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

@imonteiro
Copy link
Member Author

From martin.m...@gmail.com on July 20, 2011 09:45:57
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__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")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant