AshishJoshi-asj / zfdatagrid

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

updateColumn() returns true instead of $this #188

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

just updated to rev. 647, and found:

1. In updateColumn(), in Data.php, line 622
 if (null == $this->getSource()) {
...
    return true;  << should return $this
 }

2. $this->getSource() returning null. 
What was the change after rev 635, where all worked well? Must revert to 635...

I'm using models. ($grid->setModel() )

tried also
 $this->_zfDatagrid->setModel(new Bvb_Grid_Source_Zend_Table($this));
but no luck

3. Validator shows:
Class 'Bvb_Grid_Source_Array' must implement inherited abstract method
'resetOrder(...)'   
Array.php << same for all Source files
.../library/Bvb/Grid/Source line 21 

4. What is the current schedule to leave Alpha, and enter Beta (fixed API,
draft manual, ...), or even RC?

Original issue reported on code.google.com by vlatko.b...@gmail.com on 24 Feb 2010 at 11:49

GoogleCodeExporter commented 9 years ago
Hi,

1. Fixed. Thanks

2.
A few changes have been made.

The source have been abstracted and now the query() method has been replaced 
with
setSource() method. (You can still use it, bu tit will be deprecated and only 
works
with Zend_Db_*)

Examples:
$grid->setSource(new Bvb_Grid_Source_Zend_Select(Zend_Db_Select $select));
$grid->setSource(new Bvb_Grid_Source_Zend_Select(Zend_Db_Table_Abstract 
$model));

Should be:
$this->_zfDatagrid->setSource(new Bvb_Grid_Source_Zend_Table(MY_MODEL));

3. Fixed. Thanks

4. By the end of the month draft and RC. No 'big' changes awaited. API should 
be final.

Check http://zfdatagrid.com/grid/ source code. It has the latest revision and 
all
possible data sources examples.

Thanks for your comments,

Best Regards,
Bento Vilas Boas

Original comment by pao.fre...@gmail.com on 24 Feb 2010 at 2:42

GoogleCodeExporter commented 9 years ago
Hi,

Two issues:

A. I had to change the filter definition by adding table name (addressbook.)to 
the
Field option. Otherwise, "Field 'name' ambiguous..." appears.

->addFilter('name', array(
   'distinct' => array(
     'field' => 'addressbook.name', 
     'name' => 'name',)))

Is this intended? 

B. These Filters do not work any more:

1.
->addFilter('countryID', array(
  'distinct' => array(
    'field' => 'countryID', 

     'name' => 'countryID')))         << displays countryIDs (numbers)
     'name' => 'countries.name')))    << doesn't work
     'name' => 'countries_1.name')))  << works correctly

Table name is 'countries', but "someone" is adding '_1'.

2.
->addFilter('userID',    array(
  'distinct' => array(
    'field' => 'userID', 
    'name' => 'userID')))      << displays userIDs
    'name' => 'users.name')))  << works correctly, no '_1' in table name

Original comment by vlatko.b...@gmail.com on 24 Feb 2010 at 6:15

GoogleCodeExporter commented 9 years ago
Hi,

No, it is not an intended situation.

Please check the latest Revision 653

Best Regards,
Bento Vilas Boas

Original comment by pao.fre...@gmail.com on 25 Feb 2010 at 12:16

GoogleCodeExporter commented 9 years ago
Comment 1:

(2.) setModel() now must be explicitly called for Form. Intended?

(3.) Another function
Class 'Bvb_Grid_Source_Doctrine_Record' must implement inherited abstract method
'update(...)'
/zfDatagrid/library/Bvb/Grid/Source/Doctrine/Record.php line 21

Comment 3:
No, it doesn't work yet. I'm at rev 658.

->addFilter('countryID', array(
  'distinct' => array(
    'field' => 'countryID', 

 'name' => 'countryID')))         << displays countryIDs (numbers)
 'name' => 'countries.name')))    << doesn't work
 'name' => 'countries_1.name')))  << works correctly
 'name' => 'name')))              << displays names of Users, not countries

Original comment by vlatko.b...@gmail.com on 25 Feb 2010 at 10:09

GoogleCodeExporter commented 9 years ago
Hi,

Is countryID in your fields query?

Best Regards,
Bento Vilas Boas

Original comment by pao.fre...@gmail.com on 27 Feb 2010 at 7:29

GoogleCodeExporter commented 9 years ago
Hi,

I'm not limiting the number of fields, so all fields from model are in the 
query.

countryID is a FK in addressbook table to to countries table id. Table 
countries is
linked by reference map in a model. Below is the SQL.

This used to work before: 
 'field' => 'countryID', 
 'name' => 'countryID'

Now this works correctly, but the name "countries_1" is problematic. It is 
autogenerated.

 'field' => 'countryID', 
 'name' => 'countries_1.name'

SQL relations:

CREATE TABLE `countries` (
  `id`         int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name`       varchar(255) NOT NULL default '',
  PRIMARY KEY  (`id`),
);

CREATE TABLE  `infoverb_iva`.`addressbook` (
  `id`         int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name`       varchar(25) NOT NULL,
  `countryID`  int(11) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),

  KEY `idx_addresbook_countryID` (`countryID`) USING BTREE,
  CONSTRAINT `fk_addresbook_countries` FOREIGN KEY (`countryID`) REFERENCES
`countries` (`id`) 

);

Original comment by vlatko.b...@gmail.com on 28 Feb 2010 at 10:29

GoogleCodeExporter commented 9 years ago
Hi,

Some changes made to the model class.

Can you please try it again.

Sorry....

Best Regards,
Bento Vilas Boas

Original comment by pao.fre...@gmail.com on 28 Feb 2010 at 3:59

GoogleCodeExporter commented 9 years ago
Hi,

works now. 

Original comment by vlatko.b...@gmail.com on 28 Feb 2010 at 6:23

GoogleCodeExporter commented 9 years ago

Original comment by pao.fre...@gmail.com on 28 Feb 2010 at 9:56

GoogleCodeExporter commented 9 years ago

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