Author: KRavEN
Date: 2010-03-02 17:14:21 +0100 (Tue, 02 Mar 2010)
New Revision: 28346

Modified:
   
plugins/sfExtjsThemePlugin/branches/1_2/ExtjsGeneratorPlugin/data/generator/DbFinderAdmin/extjs/template/actions/actions.class.php
   
plugins/sfExtjsThemePlugin/branches/1_2/ExtjsGeneratorPlugin/lib/ExtjsDbFinderAdminGenerator.class.php
Log:
added edit_combo for non foreign edit fields.  Fixed the jsonCombo action to 
not show is null marker for edit combos.  fixed a notice in jsonCombo with edit 
combos.

Modified: 
plugins/sfExtjsThemePlugin/branches/1_2/ExtjsGeneratorPlugin/data/generator/DbFinderAdmin/extjs/template/actions/actions.class.php
===================================================================
--- 
plugins/sfExtjsThemePlugin/branches/1_2/ExtjsGeneratorPlugin/data/generator/DbFinderAdmin/extjs/template/actions/actions.class.php
  2010-03-02 15:24:47 UTC (rev 28345)
+++ 
plugins/sfExtjsThemePlugin/branches/1_2/ExtjsGeneratorPlugin/data/generator/DbFinderAdmin/extjs/template/actions/actions.class.php
  2010-03-02 16:14:21 UTC (rev 28346)
@@ -59,7 +59,7 @@
     }
     $this->finder = DbFinder::from($className);
 
-    if($this->getRequestParameter('isFilter')=='false' && $relatedColumnName 
!= $fields[1])
+    if($this->getRequestParameter('isFilter')=='false' && isset($fields[1]) && 
$relatedColumnName != $fields[1])
     {
       $this->finder->groupBy("$className.$relatedColumnName");
       $this->selectArr[] = "$className.$relatedColumnName";
@@ -80,7 +80,7 @@
                @list($table,$colname) = 
explode('.',sfInflector::underscore($key));
                if((isset($fields[1]) && $fields[1] == $colname) || (!$colname))
                {
-                       if(count($jsonArr) == 0)
+                       if(count($jsonArr) == 0 && 
$this->getRequestParameter('isFilter') != 'false')
                        {
                                $jsonArr[] = 
array($this->getRequestParameter('group') => '{ Is Null }');
                        }

Modified: 
plugins/sfExtjsThemePlugin/branches/1_2/ExtjsGeneratorPlugin/lib/ExtjsDbFinderAdminGenerator.class.php
===================================================================
--- 
plugins/sfExtjsThemePlugin/branches/1_2/ExtjsGeneratorPlugin/lib/ExtjsDbFinderAdminGenerator.class.php
      2010-03-02 15:24:47 UTC (rev 28345)
+++ 
plugins/sfExtjsThemePlugin/branches/1_2/ExtjsGeneratorPlugin/lib/ExtjsDbFinderAdminGenerator.class.php
      2010-03-02 16:14:21 UTC (rev 28346)
@@ -1733,6 +1733,25 @@
       // ForeignFieldColumn plugin handles renderer and editor for the column. 
 No further processing needed
       $definition = array_merge($definition, 
$this->getRelatedColumnAjaxEditDefinition($column, $groupedColumns));
     }
+    elseif(isset($params['edit_field']) && $params['edit_field'] == 'combo')
+    {
+      
+      $definition['xtype'] = 'comboboxautoload';
+      $definition['url'] = 
$this->generator->controller->genUrl($this->getModuleName() . 
'/jsonCombo.json');
+      $definition['valueField'] = $column->key;
+      $definition['displayField'] = $column->key;
+      $definition['sortField'] = $column->key;
+      $definition['groupField'] = $column->key;
+      $definition['queryParam'] = 'filters[' . $column->key . ']';
+      
+      if(isset($params['required']) && $params['required'])
+      {
+        $definition['allowBlank'] = false;
+        $definition['itemCls'] = 'required';
+        $definition['fieldLabel'] .= '<em>required</em>';
+        $definition['blankText'] = 'This field is required';
+      }
+    }
     else if($type == 'admin_double_list')
     {
       $dlDefine = $this->getDoubleListColumnAjaxEditDefinition($column, 
$groupedColumns);

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to