forked from blmage/mage-enhanced-admin-grids
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
experimental : columns can now be used for filtering only (saves plac…
…e in the results table)
- Loading branch information
Showing
17 changed files
with
372 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
app/code/community/BL/CustomGrid/Block/Widget/Grid/Columns/Filters.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
/** | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/osl-3.0.php | ||
* | ||
* @category BL | ||
* @package BL_CustomGrid | ||
* @copyright Copyright (c) 2013 Benoît Leulliette <[email protected]> | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
class BL_CustomGrid_Block_Widget_Grid_Columns_Filters | ||
extends Mage_Adminhtml_Block_Template | ||
{ | ||
protected function _construct() | ||
{ | ||
parent::_construct(); | ||
$this->setTemplate('bl/customgrid/widget/grid/columns/filters.phtml'); | ||
} | ||
|
||
public function getColumns() | ||
{ | ||
$columns = array(); | ||
|
||
if ($gridBlock = $this->getGridBlock()) { | ||
foreach ($gridBlock->getColumns() as $column) { | ||
if ($column->getBlcgFilterOnly()) { | ||
$columns[] = $column; | ||
} | ||
} | ||
} | ||
|
||
return $columns; | ||
} | ||
|
||
protected function _toHtml() | ||
{ | ||
if (!$this->getIsNewGridModel() | ||
&& ($gridBlock = $this->getGridBlock()) | ||
&& $gridBlock->getFilterVisibility()) { | ||
return parent::_toHtml(); | ||
} | ||
return ''; | ||
} | ||
|
||
// @todo next step: either enable sortability, either only apply filters, do not select values when it's not needed (eg for attribute columns and custom columns with sub-queries) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.