Development

Changeset 12003

You must first sign up to be able to contribute.

Changeset 12003

Show
Ignore:
Timestamp:
10/06/08 21:54:27 (5 years ago)
Author:
KRavEN
Message:

Added in rowactions for the list grid

rowactions in the list.display determines where the rowactions column will go

Configuration is the similar to list.actions

rowactions:

_delete:
import:

qtip: Import File
icon: server_go
callback: console.log(this)


if a callback is not specified a partial will be used and automatically created in module/templates directory
icon is the icon name of the FamFam? silk icons available via Ext.ux.IconMgr?
qtip is the quicktip text that will be seen when hovering over the icon

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfExtjsThemePlugin/trunk/config/config.php

    r11979 r12003  
    5151  '/sfExtjsThemePlugin/js/Ext.ux.BoxButton.js',               // changes button to extend BoxComponent so that it can properly be used in forms 
    5252  '/sfExtjsThemePlugin/js/Ext.ux.ValidationStatus.js', 
     53  '/sfExtjsThemePlugin/js/Ext.ux.grid.RowActions.js', 
    5354 
    5455  '/sfExtjsThemePlugin/js/Ext.ux.grid.ForeignFieldColumn.js', // grid-column which knows how to handle data from related- les (sets renderers, and combos) 
  • plugins/sfExtjsThemePlugin/trunk/data/generator/sfPropelAdmin/extjs/template/actions/actions.class.php

    r11859 r12003  
    858858?> 
    859859<?php $columnName = strtoupper($cname); ?> 
    860 <?php if (($column->key == '*') || ($cname=='')) continue ?> 
     860<?php if (($column->key == '*') || ($column->key == '^expander') || ($column->key == '^rowactions') || ($cname=='')) continue ?> 
    861861<?php $type = $column->getCreoleType() ?> 
    862862<?php 
     
    916916?> 
    917917<?php $columnName = strtoupper($cname); ?> 
    918 <?php if (($column->key == '*') || ($cname=='')) continue ?> 
     918<?php if (($column->key == '*') || ($column->key == '^expander') || ($column->key == '^rowactions') ||($cname=='')) continue ?> 
    919919<?php $type = $column->getCreoleType() ?> 
    920920<?php 
     
    11151115  } 
    11161116 
     1117  public function executeListAjaxRowActionsJs() 
     1118  { 
     1119 
     1120  } 
    11171121 
    11181122  public function executeRelatedAjaxEditors() 
     
    12451249 
    12461250    foreach ($columns as $columnName => $column) : 
    1247       if ($column->key == '*') continue; 
     1251      if ($column->key == '*' || $column->key == '^expander' || $column->key == '^rowactions') continue; 
    12481252      if (in_array($column->key, $hs)) continue; 
    12491253      if ($column->isPartial()) continue; //partials will not end up in json-data 
  • plugins/sfExtjsThemePlugin/trunk/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_columnmodel_variable_cmConfig_js.php

    r11595 r12003  
    3232  } 
    3333 
    34   //captures the * in the list.display and sets the rowexpander at that position 
    35   if ($column->key == '*') 
     34  //captures the *expander in the list.display and sets the rowexpander at that position 
     35  //new syntax is *expander, need to obsolete plain * 
     36  if ($column->key == '*'||$column->key == '^expander') 
    3637  { 
    3738    $cmItems[] = "{xtype: 'rowexpander'}"; 
     39    $i++; 
     40    continue; 
     41  } 
     42 
     43  //captures the *expander in the list.display and sets the rowexpander at that position 
     44  //new syntax is *expander, need to obsolete plain * 
     45  if ($column->key == '^rowactions') 
     46  { 
     47    $pluginArrName = strtolower($moduleName).'_rowactions'; 
     48    $plugins[$pluginArrName] = array('xtype' => 'list'.strtolower($moduleName).'rowactions'); 
     49    //set the column item to our generated plugin 
     50    $cmItems[] = 'this.'.$pluginArrName; 
    3851    $i++; 
    3952    continue; 
     
    6780    } 
    6881    //set the column item to our generated plugin 
    69     $cmItems[] = 'this.'.$pluginArrName 
    70     ; 
     82    $cmItems[] = 'this.'.$pluginArrName; 
    7183    $i++; 
    7284    continue; 
  • plugins/sfExtjsThemePlugin/trunk/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_gridpanel_js.php

    r11931 r12003  
    3333    { 
    3434      if($this->getParameterValue('list.fields.'.$col.'.plugin')) $pluginArr[] = 'this.cm.'.$col.'_'.$this->getParameterValue('list.fields.'.$col.'.plugin'); 
     35      if($col == '^rowactions') $pluginArr[] = 'this.cm.'.strtolower($moduleName).'_rowactions'; 
    3536    } 
    3637  } 
     38 
    3739?> 
    3840[?php 
  • plugins/sfExtjsThemePlugin/trunk/data/generator/sfPropelAdmin/extjs/template/templates/_list_ajax_toolbar_top_variable_ttbConfig_js.php

    r11595 r12003  
    11<?php 
    2 $moduleName = ucfirst(sfInflector::camelize($this->getModuleName())); 
    3 $toolbarName = "List".$moduleName."ToolbarTop"; 
    4  
    52$listActions = $this->getParameterValue('list.actions'); 
    63if (null === $listActions) 
  • plugins/sfExtjsThemePlugin/trunk/lib/sfExtjsPropelAdminGenerator.php

    r11945 r12003  
    115115  } 
    116116 
     117  function getAjaxRowAction($actionName, $params) 
     118  { 
     119    $params   = (array) $params; 
     120    $options  = isset($params['params']) ? sfToolkit::stringToArray($params['params']) : array(); 
     121    sfLoader::loadHelpers('Partial'); 
     122    $default_callback = 'this.'.$actionName; 
     123    $callback = false; 
     124    $default_icon = 'page_white'; 
     125    $default_qtip = $actionName; 
     126    // default values 
     127    if ($actionName[0] == '_') 
     128    { 
     129      $actionName     = substr($actionName, 1); 
     130      $default_name   = ucfirst(strtr($actionName, '_', ' ')); 
     131      $default_action = $actionName; 
     132      switch ($actionName) 
     133      { 
     134        case 'delete': 
     135          $default_icon = 'cross'; 
     136          $callback = "console.log(this)"; 
     137          $default_qtip = ucfirst($actionName); 
     138          break; 
     139      } 
     140    } 
     141    $icon   = isset($params['icon']) ? sfToolkit::replaceConstants($params['icon']) : $default_icon; 
     142    $qtip = isset($params['qtip']) ? $params['qtip'] : $default_qtip; 
     143    $callback = (!$callback)?"\$sfExtjs2Plugin->asVar('".$default_callback."')":'$sfExtjs2Plugin->asMethod("'.$callback.'")'; 
     144    $callback = isset($params['callback']) ? '$sfExtjs2Plugin->asMethod("'.$params['callback'].'")' : $callback; 
     145    $jsOptions = " 
     146      'qtip' => '$qtip', 
     147      'iconCls'    => \$sfExtjs2Plugin->asVar(\"Ext.ux.IconMgr.getIcon('".$icon."')\"), 
     148      'cb' => $callback 
     149    "; 
     150 
     151    return $jsOptions; 
     152 
     153  } 
    117154  /** 
    118155   * Returns javascript code for an action button in the toolbar new (config)style (with sfExtjs2Plugin usage). 
  • plugins/sfExtjsThemePlugin/trunk/modules/sfExtjsThemePluginXtypeManager/lib/BasesfExtjsThemePluginXtypeManagerActions.class.php

    r10892 r12003  
    3030          $action = 'listAjaxTabPanelJs'; 
    3131        } 
     32        else if (substr($xtype,-10) == 'rowactions') 
     33        { 
     34          $module = substr($xtype,4,-10); 
     35          $action = 'listAjaxRowActionsJs'; 
     36        } 
    3237 
    3338        if ($module) $url = 'js/'.$module.'/'.$action.'.pjs'; 
  • plugins/sfExtjsThemePlugin/trunk/web/css/symfony-extjs.css

    r11803 r12003  
    122122  text-decoration: underline; 
    123123} 
     124 
     125.ux-row-action-cell .x-grid3-cell-inner { 
     126  padding: 1px 0 0 0; 
     127} 
     128 
     129.ux-row-action-item { 
     130  float: left; 
     131  min-width: 16px; 
     132  height: 16px; 
     133  background-repeat: no-repeat; 
     134  margin: 0 5px 0 0; 
     135  cursor: pointer; 
     136  overflow: hidden; 
     137} 
     138 
     139.ext-ie .ux-row-action-item { 
     140  width: 16px; 
     141} 
     142 
     143.ext-ie .ux-row-action-text { 
     144  width: auto; 
     145} 
     146 
     147.ux-row-action-item span { 
     148  vertical-align: middle; 
     149  padding: 0 0 0 20px; 
     150  line-height: 18px; 
     151} 
     152 
     153.ext-ie .ux-row-action-item span { 
     154  width: auto; 
     155} 
     156 
     157/* styles for groups */ 
     158.x-grid-group-hd div { 
     159  position: relative; 
     160  height: 16px; 
     161} 
     162 
     163.ux-grow-action-item { 
     164  min-width: 16px; 
     165  height: 16px; 
     166  background-repeat: no-repeat; 
     167  background-position: 0 50% ! important; 
     168  margin: 0 0 0 4px; 
     169  padding: 0 ! important; 
     170  cursor: pointer; 
     171  float: left; 
     172} 
     173 
     174.ext-ie .ux-grow-action-item { 
     175  width: 16px; 
     176} 
     177 
     178.ux-action-right { 
     179  float: right; 
     180  margin: 0 3px 0 2px; 
     181  padding: 0 ! important; 
     182} 
     183 
     184.ux-grow-action-text { 
     185  padding: 0 ! important; 
     186  margin: 0 ! important; 
     187  background: transparent none ! important; 
     188  float: left; 
     189}