Development

Changeset 8910

You must first sign up to be able to contribute.

Changeset 8910

Show
Ignore:
Timestamp:
05/11/08 18:34:37 (5 days ago)
Author:
Leon.van.der.Ree
Message:

connected grid's datastore to (elements in) top and bottom toolbar

Files:

Legend:

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

    r8909 r8910  
    2424    'name' => '<?php echo $toolbarName ?>Config', 
    2525    'attributes' => array( 
    26       'store' => new sfExtjs2Var('new Ext.data.Store()'), // TODO: new sfExtjs2Var('parent.grid.ds'), or something like that 
    2726      'pageSize' => <?php echo $limit ?>, 
    2827      'displayInfo' => true, 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_toolbar_top_js.php

    r8909 r8910  
    2626 
    2727  //setup the configuration 
    28   $config = array( 
    29     'name' => '<?php echo $toolbarName ?>Config', 
    30     'attributes' => array( 
    31       'autoWidth' => false, 
    32       'items' => array() 
    33     ) 
     28  $config_items = array( 
     29    'autoWidth' => false, 
     30    'items' => array() 
    3431  ); 
    3532 
    3633<?php foreach ((array) $listActions as $actionName => $params): ?> 
    37   <?php echo $this->addCredentialCondition("\$config['attributes']['items'][] = \$sfExtjs2Plugin->asAnonymousClass(array(".$this->getAjaxButtonToToolbarAction($actionName, $params, false)."));\n\n", $params) ?> 
     34  <?php echo $this->addCredentialCondition("\$config_items['items'][] = \$sfExtjs2Plugin->asAnonymousClass(array(".$this->getAjaxButtonToToolbarAction($actionName, $params, false)."));\n\n", $params) ?> 
    3835<?php endforeach ?>  
    3936   
    40   echo $sfExtjs2Plugin->asAnonymousClass($config); 
    41  
    4237  // constructor 
    4338  $sfExtjs2_<?php echo $toolbarName ?>_constructor = " 
     39    <?php echo $toolbarName ?>Config = ".$sfExtjs2Plugin->asAnonymousClass($config_items)."; 
     40     
    4441    // combine <?php echo $toolbarName ?>Config with arguments 
    4542    Ext.app.sx.<?php echo $toolbarName ?>.superclass.constructor.call(this, Ext.apply(<?php echo $toolbarName ?>Config, c)); 
     
    5047    //call parent 
    5148    Ext.app.sx.<?php echo $toolbarName ?>.superclass.initComponent.apply(this, arguments); 
    52    
    5349  "; 
    54    
     50 
    5551 
    5652  // app.sx from Symfony eXtended (instead of ux: user eXtention) 
  • plugins/sfExtjsThemePlugin/data/generator/sfPropelAdmin/extjs/template/templates/listAjaxGridPanelJsSuccess.pjs

    r8909 r8910  
    4646      'cm'                  => $sfExtjs2Plugin->asVar('new Ext.app.sx.<?php echo $cmName ?>()'), 
    4747      'view'                => $sfExtjs2Plugin->asVar($sfExtjs2_gridpanel_view), 
    48       'tbar'                => $sfExtjs2Plugin->asVar('new Ext.app.sx.<?php echo $topToolbarName ?>()'), 
    49       'bbar'                => $sfExtjs2Plugin->asVar('new Ext.app.sx.<?php echo $pagingToolbarName ?>()'), 
    5048       
    5149      'autoHeight'          => true, 
     
    8785// initComponent 
    8886$sfExtjs2_<?php echo $panelName ?>_initComponent = " 
     87  // initialise items which use this grid's-store 
     88  this.tbar = new Ext.app.sx.<?php echo $topToolbarName ?>({store: this.ds}), 
     89  this.bbar = new Ext.app.sx.<?php echo $pagingToolbarName ?>({store: this.ds}), 
     90 
    8991  //call parent 
    9092  Ext.app.sx.<?php echo $panelName ?>.superclass.initComponent.apply(this, arguments); 
  • plugins/sfExtjsThemePlugin/lib/sfExtjsPropelAdminGenerator.php

    r8909 r8910  
    253253                  try { var json_response = Ext.util.JSON.decode(response.responseText); } catch (e) {}; 
    254254                  Ext.Msg.alert('Delete Status', json_response.message); 
    255                   ".$list_ns.".getDataStore().reload(); 
     255                  this.store.reload(); 
    256256                }, 
    257257                failure: function(response){ 
     
    276276          break; 
    277277        case 'refresh': 
    278           //          $list_ns = ucfirst(sfInflector::camelize($this->getModuleName()))."List"; 
    279           $default_handler_function = $list_ns.".getDataStore().reload();"; 
     278          $default_handler_function = "this.store.reload();"; 
    280279          break; 
    281280        case 'print': 
    282           //          $list_ns = ucfirst(sfInflector::camelize($this->getModuleName()))."List"; 
    283281          $default_handler_function = "window.open('".$controller->genUrl($this->getModuleName().'/listPrint')."')"; 
    284282          break; 
    285283        case 'pdf': 
    286           //          $list_ns = ucfirst(sfInflector::camelize($this->getModuleName()))."List"; 
    287           //          $default_handler_function = $list_ns.".getDataStore().reload();"; 
     284          //          $default_handler_function = "todo"; 
    288285          break; 
    289286        case 'upload': 
     
    356353                  'cls'        => 'x-btn-text-icon ".$actionClass."', 
    357354                  'disabled'   => false, 
     355                  'store'      => 'c.store', 
    358356                  'handler'    => \$sfExtjs2Plugin->asMethod(\"".$handler_function."\") 
    359357                 ";