Development

Changeset 8934

You must first sign up to be able to contribute.

Changeset 8934

Show
Ignore:
Timestamp:
05/14/08 01:30:09 (2 months ago)
Author:
Leon.van.der.Ree
Message:

implemented dynamic loading of (related)edit-panels from grid

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfExtjsThemePlugin/config/app.yml

    r8911 r8934  
    1717    use_tinymce:              false 
    1818     
    19     #grid_open_link:           window.open 
     19    #open_panel:              App.openPanel             # a method which accepts the moduleName and the item's-key, if not defined, the url will open in a new window. 
    2020     
    2121    combo_box_class: ux.ComboBoxAutoLoad # form.ComboBox  # todo: obsolete should only use xtypes! not new form.combobox... 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_renderer.php

    r8714 r8934  
    6969      $default_collapse = false; 
    7070      //TODO remove hardcoded tag for underline, add option to set stylesheet-class, don't forget to remove the closing tag as well... 
    71       $headerText .= "<u><a href=\'".$controller->genUrl($h_moduleName."/edit?".$relatedTablePK->getName()."=")."/'+record.data['".$record_pkn."']+'\' id=\'".$h_moduleName."'+record.data['".$record_pkn."']+'\'>"; 
     71      $headerText .= "<u><a class=\'gridlink\' sf_ns:modulename=\'".$h_moduleName."\' sf_ns:key=\'record.data['".$record_pkn."']\' href=\'".$controller->genUrl($h_moduleName."/edit?".$relatedTablePK->getName()."=")."/'+record.data['".$record_pkn."']+'\'>"; 
    7272    } 
    7373    $headerText .= $h_valuePrefix."'+record.data['".str_replace('/', $tableDelimiter, $columnName)."']+'".$h_valueSuffix; 
     
    123123    // a column with a value which is a link (to edit)  
    124124    function renderLink(value, params, record, rowIndex, colIndex, store, attr){ 
    125       var begin = '<u><b><a '; 
     125      var begin = '<u><b><a class=\'gridlink\' '; 
    126126       
    127127      if (typeof(attr)!=='undefined') 
     
    130130      } 
    131131       
    132       return begin+String.format('key=\'{1}\' href=\'<?php echo $controller->genUrl($this->getModuleName().'/edit?'.$pkn.'=') ?>/{1}\'>{0}</a></b></u>', value, record.data['<?php echo $key ?>']); 
     132      return begin+String.format('sf_ns:modulename=\'<?php echo $this->getModuleName() ?>\' sf_ns:key=\'{1}\' href=\'<?php echo $controller->genUrl($this->getModuleName().'/edit?'.$pkn.'=') ?>/{1}\'>{0}</a></b></u>', value, record.data['<?php echo $key ?>']); 
    133133    }  
    134134 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_related_ajax_renderer.php

    r8909 r8934  
    7575<?php if ($column->isLink()): ?> 
    7676          <?php  
    77             $url = $controller->genUrl($h_moduleName."/edit?".$relatedTablePK->getName()."="). 
    78                    '/"+record.data[\''.$record_pkn.'\']+"\' id=\''.$h_moduleName.'"+record.data[\''.$record_pkn.'\']+"'; 
     77            $url = $controller->genUrl($h_moduleName."/edit?".$relatedTablePK->getName()."=").'/"+record.data[\''.$record_pkn.'\']+"'; 
    7978          ?> 
    80           result = "<u><b><a href='<?php echo $url ?>'>"+result+"</a></b></u>"; 
     79          result = "<u><b><a class='gridlink' sf_ns:modulename='<?php echo $h_moduleName ?>' sf_ns:key='"+record.data['<?php echo $record_pkn ?>']+"' href='<?php echo $url ?>'>"+result+"</a></b></u>"; 
    8180<?php endif ?> 
    8281          return result; 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/listAjaxGridPanelJsSuccess.pjs

    r8910 r8934  
    109109 
    110110  this.on('afteredit', this.updateDB, this, true); 
     111   
     112<?php if (sfConfig::get('app_sf_extjs_theme_plugin_open_panel', null)): ?> 
     113  this.body.on({ 
     114    scope:    this, 
     115    click:    this.onLinkClick, 
     116    delegate: 'a.gridlink', 
     117    stopEvent: true 
     118  }); 
     119<?php endif; ?> 
    111120"; 
     121 
     122// openLink method 
     123$sfExtjs2_<?php echo $panelName ?>_onLinkClick = " 
     124  var el = Ext.get(e.getTarget()); 
     125  var modulename = el.getAttributeNS('sf_ns','modulename'); 
     126  var key = el.getAttributeNS('sf_ns','key'); 
     127   
     128  <?php echo sfConfig::get('app_sf_extjs_theme_plugin_open_panel', 'NS.openPanelMethod') ?>(modulename, key); 
     129"; 
     130 
    112131 
    113132// app.sx from Symfony eXtended (instead of ux: user eXtention) 
     
    123142    'initComponent' => $sfExtjs2Plugin->asMethod($sfExtjs2_<?php echo $panelName ?>_initComponent), 
    124143    'initEvents'    => $sfExtjs2Plugin->asMethod($sfExtjs2_<?php echo $panelName ?>_initEvents), 
     144     
     145    'onLinkClick'   => $sfExtjs2Plugin->asMethod(array( 
     146      'parameters' => 'e, t', 
     147      'source'     => $sfExtjs2_<?php echo $panelName ?>_onLinkClick 
     148    )), 
    125149  ) 
    126150);