-
Notifications
You must be signed in to change notification settings - Fork 16
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
problem with orderField #491
Comments
From [email protected] on December 15, 2010 23:18:08 Can you please check if this still happens? Best Regards, |
From [email protected] on December 18, 2010 22:33:00 Just test it with this simple code: $db = Zend_Db_Table_Abstract::getDefaultAdapter();
I just checked with the latest code from svn, and the orderField is not working, the column is still ordering after article_title from the case above, not article_id.. |
From [email protected] on January 26, 2011 05:27:42 Finally I got it. Please update your code to latest revision Best Regards, |
From [email protected] on February 22, 2011 16:06:10 |
From [email protected] on February 22, 2011 16:18:48 $db = Zend_Db_Table_Abstract::getDefaultAdapter();
|
Original author: [email protected] (August 12, 2010 20:38:01)
$select = $db->select ();
$select->from ( 'oferts');
$select->joinLeft ( 'images', 'oferts.oferts_id=images.img_ofert_id' );
$grid->setSource ( new Bvb_Grid_Source_Zend_Select ( $select ) );
$grid->setColumnsHidden ( $grid->getFields () );
$grid->updateColumn ( 'img_name',
array (
'title' => 'ID',
'orderField' => 'ofert_id',
'hidden' => 0,
) );
Hi. I think there is an issue with orderField feature for columns. If I set it like it is in the code aboive, it will not work.
$select = $db->select ();
$select->from ( 'oferts');
$select->joinLeft ( 'images', 'oferts.oferts_id=images.img_ofert_id' );
$grid->setSource ( new Bvb_Grid_Source_Zend_Select ( $select ) );
$grid->setColumnsHidden ( $grid->getFields () );
$grid->updateColumn ( 'img_name',
array (
'title' => 'ID',
'orderField' => 'ofert_id',
'hidden' => 0,
) );
I didn't debug a lot , but i noticed that in file Grid.php, function _buildTitles () , if i dump
Zend_Registry::get('log')->info($this->_fields); Zend_Registry::get('log')->info($this->_resetKeys($this->_data['fields']));
, the first value from $this->_fields is img_name, when the first value of
$this->_resetKeys($this->_data['fields']) is oferts_id .
To notice the problem, just dump the return value of the _buildTitles function, and you will see the orderField is not setup for the column where i setup the orderField. Just make sure, when you select, select all the values from your test table, make the all hidden using $grid->setColumnsHidden ( $grid->getFields () ); , and after that setup orderField and hidden=0 for your column.
I hope I explained the problem well.
Thank you.
Original issue: http://code.google.com/p/zfdatagrid/issues/detail?id=414
The text was updated successfully, but these errors were encountered: