Development

Changeset 8864

You must first sign up to be able to contribute.

Changeset 8864

Show
Ignore:
Timestamp:
05/08/08 19:55:29 (4 days ago)
Author:
Leon.van.der.Ree
Message:

enhancements for new list/grid in config-style by extending js-classes, added implementation for toolbars (not finished)

Files:

Legend:

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

    r8849 r8864  
    1414  $storeName = "List".$moduleName.$store; 
    1515  $cmName = "List".$moduleName.'ColumnModel'; 
    16    
     16  $topToolbarName = "List".$moduleName."ToolbarTop"; 
     17  $pagingToolbarName = "List".$moduleName."ToolbarPaging"; 
    1718   
    1819  $pk = $this->getPrimaryKeyAdminColumn(); 
     
    2627[?php include_partial('related_ajax_renderer') ?] 
    2728 
     29[?php include_partial('list_ajax_toolbar_top_js') ?] 
     30[?php include_partial('list_ajax_toolbar_paging_js') ?] 
     31 
    2832[?php include_partial('list_ajax_datastore_js') ?] 
    2933[?php include_partial('list_ajax_columnmodel_js') ?] 
    3034 
    31 <?php 
    32 if (count($this->getParameterValue('list.actions')) > 0 || $this->getParameterValue('list.actions', true)) 
    33 
    34   // topToolbar contains all action buttons in the list 
    35   $sfExtjs2Plugin_App_init .= $sfExtjs2Plugin->Toolbar(array 
    36   ( 
    37     'name' => 'topToolbar', 
    38     'attributes' => array( 
    39       'autoWidth' => false 
    40     ) 
    41   )); 
    42   $sfExtjs2Plugin_App_init .= sfExtjs2Plugin::LBR_SM; 
    43 
     35[?php 
    4436 
    45 // add a paging toolbar to the grid's footer 
    46 $sfExtjs2Plugin_App_init .= $sfExtjs2Plugin->PagingToolbar(array( 
    47   'name' => 'pagingToolbar', 
    48   'attributes' => array( 
    49     'store' => new sfExtjs2Var('ds_list'), 
    50     'pageSize' => $limit, 
    51     'displayInfo' => true, 
    52     'displayMsg' => 'Displaying '.$this->getModuleName().'s {0} - {1} of {2}', 
    53     'emptyMsg' => 'No '.$this->getModuleName().' to display' 
    54   ) 
    55 )); 
    56  ?> 
    57  
    58 <?php 
    59  
    60   $sfExtjs2_gridpanel_view = 'new Ext.grid.GridView ({forceFit: true, autoFill: true })'; 
     37  $sfExtjs2_gridpanel_view = 'new Ext.grid.GridView({forceFit: true, autoFill: true })'; 
    6138 
    6239  $config_array = array( 
    63     'ds'                  => $sfExtjs2Plugin->asVar('new Ext.app.sx.'.$storeName.'()'), 
    64     'cm'                  => $sfExtjs2Plugin->asVar('new Ext.app.sx.'.$cmName.'()'), 
    65     'view'                => $sfExtjs2Plugin->asVar($sfExtjs2_gridpanel_view), 
    66     'tbar'                => $sfExtjs2Plugin->asVar('topToolbar'), 
    67     'bbar'                => $sfExtjs2Plugin->asVar('pagingToolbar'), 
     40    'name' => '<?php echo $panelName ?>Config', 
     41    'attributes' => array( 
     42      'ds'                  => $sfExtjs2Plugin->asVar('new Ext.app.sx.<?php echo $storeName ?>()'), 
     43      'cm'                  => $sfExtjs2Plugin->asVar('new Ext.app.sx.<?php echo $cmName ?>()'), 
     44      'view'                => $sfExtjs2Plugin->asVar($sfExtjs2_gridpanel_view), 
     45      'tbar'                => $sfExtjs2Plugin->asVar('new Ext.app.sx.<?php echo $topToolbarName ?>()'), 
     46      'bbar'                => $sfExtjs2Plugin->asVar('new Ext.app.sx.<?php echo $pagingToolbarName ?>()'), 
     47       
     48      'autoHeight'          => true, 
     49      'autoScroll'          => true,  //TODO: need some work 
    6850     
    69     'autoHeight'          => true, 
    70     'autoScroll'          => true,  //TODO: need some work 
    71    
    72     'selModel'            => $sfExtjs2Plugin->RowSelectionModel(array( 
    73                               'singleSelect' => $this->getParameterValue('list.single_select', true)  
    74                              )), 
    75     'enableColLock'       => false, 
    76     'clicksToEdit'        => 1, 
    77     'trackMouseOver'      => true, 
    78                               
    79     'loadMask'            => false, 
     51      'selModel'            => $sfExtjs2Plugin->RowSelectionModel(array( 
     52                                'singleSelect' => <?php echo $this->getParameterValue('list.single_select', true) ?>  
     53                               )), 
     54      'enableColLock'       => false, 
     55      'clicksToEdit'        => 1, 
     56      'trackMouseOver'      => true, 
     57                                
     58      'loadMask'            => false, 
     59    ) 
    8060  ); 
    8161 
    82   if (sfConfig::get('app_sf_extjs_theme_plugin_list_tabbed'))   $config_array['title']            = 'Grid'; 
    83   if ($this->getParameterValue('list.grouping.plugins'))        $config_array['plugins']          = $this->getParameterValue('list.grouping.plugins'); //TODO: might require sfExtjs2Plugin->asVar ??? too late to thing now... 
    84   if ($this->getParameterValue('list.auto_expand_column'))      $config_array['autoExpandColumn'] = $this->getParameterValue('list.auto_expand_column'); 
    85    
    86   $config = $sfExtjs2Plugin->asAnonymousClass($config_array); 
    87 ?> 
     62  <?php if (sfConfig::get('app_sf_extjs_theme_plugin_list_tabbed')): ?> 
     63    $config_array['title']            = 'Grid'; 
     64  <?php endif; ?> 
     65  <?php if ($this->getParameterValue('list.grouping.plugins')): ?> 
     66    $config_array['plugins']          = '<?php echo $this->getParameterValue('list.grouping.plugins') ?>'; //TODO: might require sfExtjs2Plugin->asVar ??? too late to thing now... 
     67  <?php endif; ?> 
     68  <?php if ($this->getParameterValue('list.auto_expand_column')): ?> 
     69    $config_array['autoExpandColumn'] = '<?php echo $this->getParameterValue('list.auto_expand_column') ?>'; 
     70  <?php endif; ?> 
    8871 
    89 var <?php echo $panelName ?>Config = <?php echo $config ?>; 
    90  
     72?] 
     73[?php echo $sfExtjs2Plugin->asAnonymousClass($config_array); ?] 
    9174[?php 
    9275