Development

Changeset 8524

You must first sign up to be able to contribute.

Changeset 8524

Show
Ignore:
Timestamp:
04/18/08 15:50:07 (7 months ago)
Author:
KRavEN
Message:

Made some changes to the _list_ajax_layout to make it easier to add methods
Added some changes to the grid row doubleclick listener/methods

Files:

Legend:

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

    r8279 r8524  
    789789    if (isset($this->groupby['<?php echo str_replace('/', $tableDelimiter, $column->key) ?>'])) 
    790790    { 
     791      $c->addSelectColumn(<?php echo $peerClassName ?>::<?php echo $columnName ?>); 
    791792      $c->addGroupByColumn(<?php echo $peerClassName ?>::<?php echo $columnName ?>); 
    792793    } 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_grid_rowdblclick.php

    r8242 r8524  
    1 <?php 
    2 // get the controller, used for URL creation 
    3 $controller = sfContext::getInstance()->getController(); 
    4  
    5 // get first primary key of class 
    6 $pkn = $this->getPrimaryKeyAdminColumn()->getName(); 
    7  
    8 // get action 
    9 $action = $this->getParameterValue('list.object_dblclick'); 
    10 ?> 
    11 gridPanel.doRowDBLClick = function(grid, rowIndex, e) { 
    12         e.stopEvent(); 
    13         var coords = e.getXY(); 
    14         var rowRecord = gridPanel.getStore().getAt(rowIndex); 
    15  
    16         window.location.href = '<?php echo $controller->genUrl($this->getModuleName().'/'.$action)."?".$pkn."=' + rowRecord['".$pkn."']" ?>; 
    17       } 
    18        
    19 gridPanel.addListener('rowdblclick', gridPanel.doRowDBLClick); 
     1      gridPanel.addListener('rowdblclick', this.doRowDblClick); 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_layout.php

    r8345 r8524  
    1010 
    1111$list_ns = ucfirst(sfInflector::camelize($this->getModuleName()))."List"; 
     12 
     13$publicMethods = array(); 
    1214 
    1315$limit = $this->getParameterValue('list.max_per_page', sfConfig::get('app_sf_extjs_theme_plugin_list_max_per_page', 20)); 
     
    139141} 
    140142 
    141 if ($this->getParameterValue('list.object_dblclick')) 
     143if ($this->getParameterValue('list.object_rowdblclick')) 
    142144{ 
    143   $sfExtjs2Plugin_App_init .= "[?php include_partial('list_ajax_grid_dblclick') ?]"; 
     145  $sfExtjs2Plugin_App_init .= "[?php include_partial('list_ajax_grid_rowdblclick') ?]"; 
     146  $sfExtjs2Plugin_App_doRowDblClick = "[?php include_partial('list_ajax_doRowDblClick') ?]"; 
     147  $publicMethods['doRowDblClick'] = $sfExtjs2Plugin->asMethod(array('source'=>$sfExtjs2Plugin_App_doRowDblClick,'parameters'=>'grid, rowIndex, e')); 
    144148} 
    145149 
     
    148152$sfExtjs2Plugin_App_addTab = "[?php include_partial('list_ajax_addTab') ?]"; 
    149153 
     154$publicMethods['init'] = $sfExtjs2Plugin->asMethod($sfExtjs2Plugin_App_init); 
     155$publicMethods['updateDB'] = $sfExtjs2Plugin->asMethod(array('source'=>$sfExtjs2Plugin_App_updateDB,'parameters'=>'grid')); 
     156$publicMethods['addTab'] = $sfExtjs2Plugin->asMethod(array('source'=>$sfExtjs2Plugin_App_addTab,'parameters'=>'tabTitle, tabUrl, tabId, params, icon, closeable, active')); 
     157$publicMethods['getTabPanel'] = $sfExtjs2Plugin->asMethod('return tabPanel;'); 
     158$publicMethods['getDataStore'] = $sfExtjs2Plugin->asMethod('return ds_list;'); 
     159$publicMethods['getGridPanel'] = $sfExtjs2Plugin->asMethod('return gridPanel;'); 
     160 
     161$privateMethods = array( 
     162  'ds_list'         => null, 
     163  'cm'              => null, 
     164  'view'            => null, 
     165  'gridPanel'       => null, 
     166  'topToolbar'      => null, 
     167  'pagingToolbar'   => null, 
     168  'gridContextMenu' => null, 
     169  'tabPanel'        => null 
     170); 
     171 
    150172// build application 
    151173$sfExtjs2Plugin->beginApplication(array( 
    152174  'name'    => $list_ns, 
    153   'private' => array( 
    154     'ds_list'         => null, 
    155     'cm'              => null, 
    156     'view'            => null, 
    157     'gridPanel'       => null, 
    158     'topToolbar'      => null, 
    159     'pagingToolbar'   => null, 
    160     'gridContextMenu' => null, 
    161     'tabPanel'        => null 
    162   ), 
    163   'public'  => array( 
    164     'init'         => $sfExtjs2Plugin->asMethod($sfExtjs2Plugin_App_init), 
    165     'updateDB'     => $sfExtjs2Plugin->asMethod(array('source'=>$sfExtjs2Plugin_App_updateDB,'parameters'=>'grid')), 
    166     'addTab'       => $sfExtjs2Plugin->asMethod(array('source'=>$sfExtjs2Plugin_App_addTab,'parameters'=>'tabTitle, tabUrl, tabId, params, icon, closeable, active')), 
    167     'getTabPanel'  => $sfExtjs2Plugin->asMethod('return tabPanel;'), 
    168     'getDataStore' => $sfExtjs2Plugin->asMethod('return ds_list;'), 
    169     'getGridPanel' => $sfExtjs2Plugin->asMethod('return gridPanel;') 
    170   ) 
    171 )); 
     175  'public'  => $publicMethods, 
     176  'private' => $privateMethods)); 
     177 
    172178$sfExtjs2Plugin->endApplication(); 
    173179$sfExtjs2Plugin->initApplication($list_ns, true);