Development

Changeset 6858

You must first sign up to be able to contribute.

Changeset 6858

Show
Ignore:
Timestamp:
12/31/07 17:06:51 (1 year ago)
Author:
Leon.van.der.Ree
Message:

added feature to disable collapsing in grouped-grids, when the group-header contains a link.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_renderer.php

    r6788 r6858  
    3333  $headerText = ""; 
    3434 
     35  // default value if groups are collapsable 
     36  $default_collapse = true; 
     37   
    3538  //iterate through all columns for grouping display 
    3639  foreach ($columns as $columnName => $column) 
     
    7982    if ($column->isLink()) 
    8083    { 
     84      // if the group header contains a link, disable collapsing 
     85      $default_collapse = false; 
    8186      //TODO remove hardcoded tag for underline, add option to set stylesheet-class, don't forget to remove the closing tag as well... 
    8287      $headerText .= "<u><a href=\'".$controller->genUrl($h_moduleName."/edit?".$url_pkn."=")."/'+record.data['".$record_pkn."']+'\'>"; 
     
    8792      $headerText .= "</a></u>"; 
    8893    } 
     94  } 
     95   
     96  $collapse = $this->getParameterValue('list.grouping.collapsable', $default_collapse); 
     97  //if not collapsable change css 
     98  if (!$collapse) 
     99  { 
     100    // TODO: this does not (reliably) seem to work, maybe we should move this to the action.class 
     101    $response = sfContext::getInstance()->getResponse(); 
     102    $response->addStylesheet('/sfExtjsThemePlugin/css/collapsing-disabled', 'last'); 
     103?> 
     104    //disable collapsable group-headers 
     105    Ext.override(Ext.grid.GroupingView, { 
     106        interceptMouse : Ext.emptyFn 
     107    }); 
     108     
     109<?php 
    89110  } 
    90111}