Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • None
  • system
    • base
    • caching
    • console
    • db
      • ar
      • schema
    • validators
    • web
      • actions
      • auth
      • helpers
      • widgets
        • captcha
        • pagers
  • zii
    • widgets
      • grid

Classes

  • AccountsGridViewProfileWidget
  • ActionMenu
  • ActionsGridViewProfileWidget
  • ActionsQuickCreateRelationshipBehavior
  • ActiveDateRangeInput
  • ApplicationConfigBehavior
  • Attachments
  • ChatBox
  • CommonControllerBehavior
  • ContactMapInlineTags
  • ContactsGridViewProfileWidget
  • CronForm
  • CSaveRelationsBehavior
  • DateRangeInputsWidget
  • DocsGridViewProfileWidget
  • DocViewer
  • DocViewerProfileWidget
  • EButtonColumnWithClearFilters
  • EmailDeliveryBehavior
  • EmailProgressControl
  • EncryptedFieldsBehavior
  • EventsChartProfileWidget
  • FileUploader
  • FontPickerInput
  • Formatter
  • FormView
  • GridViewWidget
  • History
  • IframeWidget
  • ImportExportBehavior
  • InlineActionForm
  • InlineEmailAction
  • InlineEmailForm
  • InlineEmailModelBehavior
  • InlineQuotes
  • JSONEmbeddedModelFieldsBehavior
  • JSONFieldsDefaultValuesBehavior
  • LeadRoutingBehavior
  • LeftWidget
  • LoginThemeHelper
  • LoginThemeHelperBase
  • MarketingGridViewProfileWidget
  • MediaBox
  • MessageBox
  • MobileFormatter
  • MobileFormLayoutRenderer
  • MobileLayoutRenderer
  • MobileLoginThemeHelper
  • MobileViewLayoutRenderer
  • ModelFileUploader
  • NewWebLeadsGridViewProfileWidget
  • NormalizedJSONFieldsBehavior
  • NoteBox
  • OnlineUsers
  • OpportunitiesGridViewProfileWidget
  • Panel
  • ProfileDashboardManager
  • ProfileGridViewWidget
  • ProfileLayoutEditor
  • ProfilesGridViewProfileWidget
  • Publisher
  • PublisherActionTab
  • PublisherCalendarEventTab
  • PublisherCallTab
  • PublisherCommentTab
  • PublisherEventTab
  • PublisherSmallCalendarEventTab
  • PublisherTab
  • PublisherTimeTab
  • QuickContact
  • QuickCreateRelationshipBehavior
  • QuotesGridViewProfileWidget
  • RecordAliasesWidget
  • RecordViewLayoutManager
  • RecordViewWidgetManager
  • RememberPagination
  • Reminders
  • ResponseBehavior
  • ResponsiveHtml
  • SearchIndexBehavior
  • ServicesGridViewProfileWidget
  • SmallCalendar
  • SmartActiveDataProvider
  • SmartDataProviderBehavior
  • SmartSort
  • SocialForm
  • SortableWidgetManager
  • SortableWidgets
  • TagBehavior
  • TagCloud
  • TemplatesGridViewProfileWidget
  • TimeZone
  • TopContacts
  • TopSites
  • TransformedFieldStorageBehavior
  • TranslationLogger
  • TwitterFeed
  • TwoColumnSortableWidgetManager
  • UpdaterBehavior
  • UpdatesForm
  • UserIdentity
  • UsersChartProfileWidget
  • WorkflowBehavior
  • X2ActiveGridView
  • X2ActiveGridViewForSortableWidgets
  • X2AssetManager
  • X2AuthManager
  • X2ChangeLogBehavior
  • X2ClientScript
  • X2Color
  • X2DateUtil
  • X2FixtureManager
  • X2FlowFormatter
  • X2GridView
  • X2GridViewBase
  • X2GridViewForSortableWidgets
  • X2GridViewSortableWidgetsBehavior
  • X2LeadsGridViewProfileWidget
  • X2LinkableBehavior
  • X2ListView
  • X2PillBox
  • X2ProgressBar
  • X2SmartSearchModelBehavior
  • X2TimestampBehavior
  • X2TranslationBehavior
  • X2UrlRule
  • X2WebModule
  • X2Widget
  • X2WidgetList
  • Overview
  • Package
  • Class
  • Tree

Class EButtonColumnWithClearFilters

EButtonColumnWithClearFilters class.

The EButtonColumnWithClearFilters extension adds up some functionality to the default possibilites of zii's CButtonColumn implementation.

An image will be placed in the top column(on same line of AJAX filters). When clicked the filters will be cleared, the content will be refreshed with all items available.

To use this extension, just copy this file to your components/ directory, add 'import' => 'application.components.EButtonColumnWithClearFilters', [...] to your config/main.php and use this column on each widget's Column array you would like to inherit the new possibilities:

array( 'class'=>'EButtonColumnWithClearFilters', //'clearVisible'=>true, //'onClick_BeforeClear'=>'alert('this js fragment executes before clear');', //'onClick_AfterClear'=>'alert('this js fragment executes after clear');', //'clearHtmlOptions'=>array('class'=>'custom-clear'), //'imageUrl'=>'/path/to/custom/image/delete.png', //'url'=>'Yii::app()->controller->createUrl(Yii::app()->controller->action->ID,array("clearFilters"=>1))', //'label'=>'My Custom Label', ),

In your controller in the same action the widget is displayed, you have to add

if (intval(Yii::app()->request->getParam('clearFilters'))==1) { $model->unsetAttributes(); $this->redirect(array($this->action->ID)); }

All posible customizations have been enumerated above, you shall comment out those that you won't override. The minial setup is just the class type for the Columns.

clearVisible: a PHP expression for determining whether the button is visible

onClick_BeforeClear: If you want to execute certain JS code before the filters are cleared out, use this property to pass your custom code. You are allowed to use 'return false;' only, when you want to stop the clear to happen. This will stop all further JS code, and HTTP request to be executed. You are not allowed to use 'return true;' it will break the components usage.

onClick_AfterClear: If you want to execute certain JS code after clear, but before the AJAX call use this property to pass your custom code. You are allowed to use 'return false' only, when you want to stop the AJAX call to happen. This will stop the form to be reloaded. If you want to clear the form by classic GET request, and not by ajax you shall 'return true;' here.

clearHtmlOptions: Associative array of html elements to be passed for the button default is: array('class'=>'clear','id'=>'cbcwr_clear','style'=>'text-align:center;display:block;');

imageUrl: image URL of the button. If not set or false, a text link is used Default is: $this->grid->baseScriptUrl.'/delete.png'

url: a PHP expression for generating the URL of the button Default is: Yii::app()->controller->createUrl(Yii::app()->controller->action->ID,array("clearFilters"=>1))

label: Label tag to be used on the button when no URL is given Default is: Clear Filters

This extension comes handy when you use Remember Filters extension for GridView http://www.yiiframework.com/extension/remember-filters-gridview

Please VOTE this extension if helps you at: http://www.yiiframework.com/extension/clear-filters-gridview

CComponent
Extended by CGridColumn
Extended by CButtonColumn
Extended by EButtonColumnWithClearFilters
Package: application\components
License: http://opensource.org/licenses/bsd-license.php
Author: Marton Kodok http://www.yiiframework.com/forum/index.php?/user/8824-pentium10/
Version: 1.0
Link: http://www.yiiframework.com/
Located at x2engine/protected/components/EButtonColumnWithClearFilters.php
Methods summary
public
# init( )

Initializes the column. This method registers necessary client script for the button column.

Initializes the column. This method registers necessary client script for the button column.

Overrides

CButtonColumn::init()
public
# renderFilterCell( )

Renders the filter cell.

Renders the filter cell.

Since

1.1.1

Overrides

CGridColumn::renderFilterCell()
public static
# clearFilters( mixed $controller, mixed $model )
Methods inherited from CButtonColumn
getDataCellContent(), initDefaultButtons(), registerClientScript(), renderButton()
Methods inherited from CGridColumn
__construct(), getFilterCellContent(), getFooterCellContent(), getHasFooter(), getHeaderCellContent(), renderDataCell(), renderDataCellContent(), renderFilterCellContent(), renderFooterCell(), renderFooterCellContent(), renderHeaderCell(), renderHeaderCellContent()
Methods inherited from CComponent
__call(), __get(), __isset(), __set(), __unset(), asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Properties summary
public string $clearVisible
#

a PHP expression for determining whether the button is visible

a PHP expression for determining whether the button is visible

public string $onClick_BeforeClear
#

JS code to be invoked when the button is clicked, this is invoked before clearing the form fields; Returning false from this code fragment prevents the AJAX to be executed. Only use 'return' block when you want to stop further steps execution.

JS code to be invoked when the button is clicked, this is invoked before clearing the form fields; Returning false from this code fragment prevents the AJAX to be executed. Only use 'return' block when you want to stop further steps execution.

public string $onClick_AfterClear
#

JS code to be invoked when the button is clicked, this is invoked after clearing the form fields, before AJAX; Returning false from this code fragment prevents the AJAX to be executed. Only use 'return' block when you want to stop further steps execution.

JS code to be invoked when the button is clicked, this is invoked after clearing the form fields, before AJAX; Returning false from this code fragment prevents the AJAX to be executed. Only use 'return' block when you want to stop further steps execution.

public array $clearHtmlOptions
#

Associative array of html elements to be passed for the button default is: array('class'=>'clear','id'=>'cbcwr_clear','style'=>'text-align:center;display:block;');

Associative array of html elements to be passed for the button default is: array('class'=>'clear','id'=>'cbcwr_clear','style'=>'text-align:center;display:block;');

public string $imageUrl
#

image URL of the button. If not set or false, a text link is used Default is: $this->grid->baseScriptUrl.'/delete.png'

image URL of the button. If not set or false, a text link is used Default is: $this->grid->baseScriptUrl.'/delete.png'

public string $url
#

a PHP expression for generating the URL of the button Default is: Yii::app()->controller->createUrl(Yii::app()->controller->action->ID,array("clearFilters"=>1))

a PHP expression for generating the URL of the button Default is: Yii::app()->controller->createUrl(Yii::app()->controller->action->ID,array("clearFilters"=>1))

public unknown_type $label
#

Label tag to be used on the button when no URL is given Default is: Clear Filters

Label tag to be used on the button when no URL is given Default is: Clear Filters

Properties inherited from CButtonColumn
$afterDelete, $buttons, $deleteButtonImageUrl, $deleteButtonLabel, $deleteButtonOptions, $deleteButtonUrl, $deleteConfirmation, $footerHtmlOptions, $headerHtmlOptions, $htmlOptions, $template, $updateButtonImageUrl, $updateButtonLabel, $updateButtonOptions, $updateButtonUrl, $viewButtonImageUrl, $viewButtonLabel, $viewButtonOptions, $viewButtonUrl
Properties inherited from CGridColumn
$cssClassExpression, $filterHtmlOptions, $footer, $grid, $header, $id, $visible
Magic properties inherited from CGridColumn
$filterCellContent, $footerCellContent, $hasFooter, $headerCellContent
X2CRM Documentation API documentation generated by ApiGen 2.8.0