Author: KRavEN
Date: 2010-09-22 17:27:33 +0200 (Wed, 22 Sep 2010)
New Revision: 30964

Modified:
   
plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/paginationAction.php
   plugins/ExtjsGeneratorPlugin/trunk/lib/form/ExtjsFormFilterPropel.class.php
   plugins/ExtjsGeneratorPlugin/trunk/web/js/Ext.ux.list.GroupingListView.js
Log:
changed buildQuery and filter classes to support adding queryMethods and with 
statements before the form criteria is created.

Modified: 
plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/paginationAction.php
===================================================================
--- 
plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/paginationAction.php
      2010-09-22 13:26:09 UTC (rev 30963)
+++ 
plugins/ExtjsGeneratorPlugin/trunk/data/generator/ExtjsModule/admin/parts/paginationAction.php
      2010-09-22 15:27:33 UTC (rev 30964)
@@ -19,13 +19,8 @@
 
   protected function buildQuery()
   {
-<?php if ($this->configuration->hasFilterForm()): ?>
-    if (null === $this->filters) $this->getFilterForm();
-    $query = $this->filters->buildCriteria($this->getFilters());
-<?php else: ?>
     $query = PropelQuery::from('<?php echo $this->getModelClass() ?>');
-<?php endif; ?>
-
+    
     foreach ($this->configuration->getWiths() as $with) {
       $query->joinWith($with);
     }
@@ -33,6 +28,11 @@
     foreach ($this->configuration->getQueryMethods() as $method) {
       $query->$method();
     }
+    
+<?php if ($this->configuration->hasFilterForm()): ?>
+    if (null === $this->filters) $this->getFilterForm();
+    $query = $this->filters->buildCriteria($this->getFilters(), $query);    
+<?php endif; ?>
 
     $this->processSort($query);
 

Modified: 
plugins/ExtjsGeneratorPlugin/trunk/lib/form/ExtjsFormFilterPropel.class.php
===================================================================
--- plugins/ExtjsGeneratorPlugin/trunk/lib/form/ExtjsFormFilterPropel.class.php 
2010-09-22 13:26:09 UTC (rev 30963)
+++ plugins/ExtjsGeneratorPlugin/trunk/lib/form/ExtjsFormFilterPropel.class.php 
2010-09-22 15:27:33 UTC (rev 30964)
@@ -8,6 +8,11 @@
    * @return array An array of fields with their foreign query method
    */
   abstract public function getForeignColumnQueries();
+  
+  public function buildCriteria(array $values, ModelCriteria $criteria = null)
+  {
+    return $this->doBuildCriteria($this->processValues($values), $criteria);
+  }
 
   /**
    * Builds a Propel Criteria with processed values.
@@ -19,9 +24,9 @@
    *
    * @return Criteria
    */
-  protected function doBuildCriteria(array $values)
+  protected function doBuildCriteria(array $values, ModelCriteria $criteria = 
null)
   {
-    $criteria = PropelQuery::from($this->getModelName());
+    $criteria = ($criteria) ? $criteria : 
PropelQuery::from($this->getModelName());
     $peer = $criteria->getModelPeerName();
     
     $fields = $this->getFields();

Modified: 
plugins/ExtjsGeneratorPlugin/trunk/web/js/Ext.ux.list.GroupingListView.js
===================================================================
--- plugins/ExtjsGeneratorPlugin/trunk/web/js/Ext.ux.list.GroupingListView.js   
2010-09-22 13:26:09 UTC (rev 30963)
+++ plugins/ExtjsGeneratorPlugin/trunk/web/js/Ext.ux.list.GroupingListView.js   
2010-09-22 15:27:33 UTC (rev 30964)
@@ -140,6 +140,34 @@
     expanded = Ext.isDefined(expanded) ? expanded : 
gel.hasClass('x-grid-group-collapsed');
     this.groupState[groupIndex] = expanded;
     gel[expanded ? 'removeClass' : 'addClass']('x-grid-group-collapsed');
+  },
+  
+  /**
+   * Toggles all groups if no value is passed, otherwise sets the expanded
+   * state of all groups to the value passed.
+   * 
+   * @param {Boolean}
+   *          expanded (optional)
+   */
+  toggleAllGroups : function(expanded) {
+    var groups = this.getGroups();
+    for (var i = 0, len = groups.length; i < len; i++) {
+      this.toggleGroup(groups[i], expanded);
+    }
+  },
+
+  /**
+   * Expands all grouped rows.
+   */
+  expandAllGroups : function() {
+    this.toggleAllGroups(true);
+  },
+
+  /**
+   * Collapses all grouped rows.
+   */
+  collapseAllGroups : function() {
+    this.toggleAllGroups(false);
   }
 
 }

-- 
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