Development

Changeset 8834

You must first sign up to be able to contribute.

Changeset 8834

Show
Ignore:
Timestamp:
05/07/08 15:07:56 (4 months ago)
Author:
Leon.van.der.Ree
Message:

Re-implementation of grid-panel in pjs files.
in this implementation column-redentials should have effect

Files:

Legend:

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

    r8135 r8834  
    1616$groupedColumns = $this->getColumnsGrouped($for, true); 
    1717$columns = $this->getListColumns($groupedColumns, false); 
    18  
    19 // "sort" output on index, since index should be unique, this is easy 
    20 // first create a new array 
    21 $temp = array(); 
    22 foreach ($columns as $column) 
    23 
    24   $temp[$column->index] = $column; 
    25 
    26 // do real sortining 
    27 ksort($temp); 
    28 // put sorted array back 
    29 $columns  = $temp; 
     18$columns = $this->sortColumns($columns); 
    3019 
    3120$cmOptions = array();  
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/listAjaxGridPanelJsSuccess.pjs

    r8803 r8834  
    11<?php 
    2 // get the controller, used for URL creation 
    3 $controller = sfContext::getInstance()->getController(); 
    4 $sfExtjs2Plugin = new sfExtjs2Plugin(); 
     2  // get the controller, used for URL creation 
     3  $controller = sfContext::getInstance()->getController(); 
     4  $sfExtjs2Plugin = new sfExtjs2Plugin(); 
     5   
     6  $moduleName = ucfirst(sfInflector::camelize($this->getModuleName())); 
     7  $list_ns = $moduleName."List"; 
     8  $panelName = "List".$moduleName."GridPanel"; 
    59 
    6 $moduleName = ucfirst(sfInflector::camelize($this->getModuleName())); 
    7 $list_ns = $moduleName."List"; 
    8 $panelName = "List".$moduleName."GridPanel"; 
     10  // set group field 
     11  $group_field = $this->getParameterValue('list.grouping.field', null); 
     12   
     13  $store = 'Store'; if ($group_field) $store = 'Grouping'.$store; 
     14  $storeName = "List".$moduleName.$store; 
     15  $cmName = "List".$moduleName.'ColumnModel'; 
     16   
     17   
     18  $pk = $this->getPrimaryKeyAdminColumn(); 
     19  $pkn = $pk->getName(); 
     20?> 
     21[?php 
     22  $sfExtjs2Plugin = new sfExtjs2Plugin(); 
     23?] 
    924 
    10 $pk = $this->getPrimaryKeyAdminColumn(); 
    11 $pkn = $pk->getName(); 
    12 ?> 
    13 <?php  
     25[?php include_partial('list_ajax_renderer') ?] 
     26[?php include_partial('related_ajax_renderer') ?] 
     27 
     28[?php include_partial('list_ajax_datastore_js') ?] 
     29[?php include_partial('list_ajax_columnmodel_js') ?] 
     30 
     31<?php 
     32 
    1433  $config_array = array( 
    15     'ds'                  => $sfExtjs2Plugin->asVar('ds_list'), 
    16     'cm'                  => $sfExtjs2Plugin->asVar('cm'), 
    17     'view'                => $sfExtjs2Plugin->asVar('view'), 
    18     'tbar'                => $sfExtjs2Plugin->asVar('topToolbar'), 
    19     'bbar'                => $sfExtjs2Plugin->asVar('pagingToolbar'), 
     34    'ds'                  => $sfExtjs2Plugin->asVar('new Ext.app.sx.'.$storeName.'()'), 
     35    'cm'                  => $sfExtjs2Plugin->asVar('new Ext.app.sx.'.$cmName.'()'), 
     36    'view'                => $sfExtjs2Plugin->asVar('new Ext.grid.GridView ({forceFit: true, autoFill: true })'), 
     37//    'tbar'                => $sfExtjs2Plugin->asVar('topToolbar'), 
     38//    'bbar'                => $sfExtjs2Plugin->asVar('pagingToolbar'), 
    2039     
    2140    'autoHeight'          => true, 
     
    3958?> 
    4059 
    41 [?php 
    42   $sfExtjs2Plugin = new sfExtjs2Plugin(); 
    43 ?] 
    44  
    4560var <?php echo $panelName ?>Config = <?php echo $config ?>; 
    4661 
    4762[?php 
    4863 
     64// constructor 
     65$sfExtjs2_<?php echo $panelName ?>_constructor = " 
     66  Ext.app.sx.<?php echo $panelName ?>.superclass.constructor.apply(this, arguments); 
     67"; 
     68 
    4969// initComponent 
    5070$sfExtjs2_<?php echo $panelName ?>_initComponent = " 
     71  //apply extra config 
    5172  Ext.apply(this, this.initialConfig, <?php echo $panelName ?>Config); 
    5273  //call parent 
     
    7293  'Ext.grid.EditorGridPanel', 
    7394  array ( 
     95    'constructor'   => $sfExtjs2Plugin->asMethod($sfExtjs2_<?php echo $panelName ?>_constructor), 
    7496    'initComponent' => $sfExtjs2Plugin->asMethod($sfExtjs2_<?php echo $panelName ?>_initComponent), 
    7597    'initEvents'    => $sfExtjs2Plugin->asMethod($sfExtjs2_<?php echo $panelName ?>_initEvents),