AshishJoshi-asj / zfdatagrid

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

sqlexp should follow Format of its parent column/field #179

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. set a Format to a column/field (e.g. currency)
2. add sqlexp for the same column/field to the Grid
3.

What is the expected output? What do you see instead?

sqlexp formatted as its parent column
sqlexp value without formatting

What version of the product are you using? On what operating system?
0,6alpha

Please provide any additional information below.
sqlexp does accept Format parameter, but if not set, it might accept its
parent format.

Original issue reported on code.google.com by vlatko.b...@gmail.com on 19 Feb 2010 at 6:44

GoogleCodeExporter commented 9 years ago

Original comment by pao.fre...@gmail.com on 22 Feb 2010 at 2:18

GoogleCodeExporter commented 9 years ago
Hi,

What happens if I don't want to apply any format to the sqlExp?

Best Regards,
Bento Vilas Boas

Original comment by pao.fre...@gmail.com on 27 Feb 2010 at 5:12

GoogleCodeExporter commented 9 years ago
Hi,

I think that format inheritance should take place only if sqlExp hasn't got its 
own
format defined. 

So, if no format is desired

 $grid->sqlexp = array(
   'fld'   => array(
     'functions' => array('count'),
     'value'     => 'fld'
     'format'    => ''      << no format at all
     'format'    => 'date'  << format is date
//     'format'    => ''    << format is inherited
  ),

I think that in most use cases, sqlExp format would be the same as its column 
(e.g.
sum(money), avg(age),...).

Original comment by vlatko.b...@gmail.com on 28 Feb 2010 at 9:07

GoogleCodeExporter commented 9 years ago
Hi,

Fixed the format thing.

If not set the value option, it will be assumed the field name

Best Regards,
Bento Vilas Boas

Original comment by pao.fre...@gmail.com on 2 Mar 2010 at 1:30

GoogleCodeExporter commented 9 years ago

Original comment by bento.vi...@gmail.com on 3 Mar 2010 at 4:56