madcorp / zfdatagrid

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

Column titles issue [setUseVerticalInputs(false)] - possible fix #820

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi Bento,

As refered in other tickets the titles defined by user 
($grid->updateColumn(....)) are ignored when using setUseVerticalInputs(false).

To fix this I changed Grid/Deploy/Table.php. On line 2402, after:

if ($crud->getUseVerticalInputs() === false) {
   $arr[0] = new Zend_Form_SubForm($formElements);

   if ($formsCount > 1)
     $arr[0]->addElement('checkbox', 'ZFIGNORE', array('label' => $this->__('Ignore'), 'order' => 0));
   $arr[0]->setElementDecorators($crud->getSubformElementTitle());

add this code:

foreach ($this->_data['fields'] as $key => $title) {
   if ($arr[0]->getElement($key)) {
      $arr[0]->getElement($key)->setLabel($title['title']);
   }
}

Now titles works fine with setUseVerticalInputs(false).

You agree with this code?

Regards
IM

Original issue reported on code.google.com by ivomonte...@gmail.com on 7 Feb 2012 at 7:19

GoogleCodeExporter commented 9 years ago

Original comment by ivomonte...@gmail.com on 22 Feb 2012 at 3:52