YiiWheels
  • Package
  • Class
  • Tree

Packages

  • None
  • yiiwheels
    • behaviors
    • widgets
    • widgets
      • ace
      • box
      • datepicker
      • daterangepicker
      • datetimepicker
      • detail
      • fileupload
      • fileuploader
      • gallery
      • google
      • grid
        • behaviors
        • operations
      • highcharts
      • maskInput
      • maskmoney
      • modal
      • multiselect
      • rangeslider
      • redactor
      • select2
      • sparklines
      • switch
      • timeago
      • timepicker
      • toggle
      • typeahead

Classes

  • WhToggleAction
  • WhToggleColumn

Class WhToggleColumn

TbDataColumn
Extended by WhToggleColumn
Package: YiiWheels\widgets\toggle
Copyright: Copyright © 2amigos.us 2013-
License: New BSD License
Author: Antonio Ramirez <amigo.cobos@gmail.com>
Located at widgets/grid/WhToggleColumn.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.

protected
# initButton( )

Initializes the default buttons (toggle).

Initializes the default buttons (toggle).

protected
# renderDataCellContent( integer $row, mixed $data )

Renders the data cell content. This method renders the view, update and toggle buttons in the data cell.

Renders the data cell content. This method renders the view, update and toggle buttons in the data cell.

Parameters

$row
integer
$row the row number (zero-based)
$data
mixed
$data the data associated with the row
protected
# registerClientScript( )

Registers the client scripts for the button column.

Registers the client scripts for the button column.

Magic methods summary

Properties summary

public string $name
#

the attribute name of the data model. Used for column sorting, filtering and to render the corresponding attribute value in each data cell. If value is specified it will be used to rendered the data cell instead of the attribute value.

the attribute name of the data model. Used for column sorting, filtering and to render the corresponding attribute value in each data cell. If value is specified it will be used to rendered the data cell instead of the attribute value.

See

value
WhToggleColumn::$sortable
public array $htmlOptions
#

the HTML options for the data cell tags.

the HTML options for the data cell tags.

public array $headerHtmlOptions
#

the HTML options for the header cell tag.

the HTML options for the header cell tag.

public array $footerHtmlOptions
#

the HTML options for the footer cell tag.

the HTML options for the footer cell tag.

public string $checkedButtonLabel
#

the label for the toggle button. Defaults to "Check". Note that the label will not be HTML-encoded when rendering.

the label for the toggle button. Defaults to "Check". Note that the label will not be HTML-encoded when rendering.

public string $uncheckedButtonLabel
#

the label for the toggle button. Defaults to "Uncheck". Note that the label will not be HTML-encoded when rendering.

the label for the toggle button. Defaults to "Uncheck". Note that the label will not be HTML-encoded when rendering.

public string $emptyButtonLabel
#

the label for the NULL value toggle button. Defaults to "Not Set". Note that the label will not be HTML-encoded when rendering.

the label for the NULL value toggle button. Defaults to "Not Set". Note that the label will not be HTML-encoded when rendering.

public string $checkedIcon
#

the glyph icon toggle button "checked" state. You may set this property to be false to render a text link instead.

the glyph icon toggle button "checked" state. You may set this property to be false to render a text link instead.

public string $uncheckedIcon
#

the glyph icon toggle button "unchecked" state. You may set this property to be false to render a text link instead.

the glyph icon toggle button "unchecked" state. You may set this property to be false to render a text link instead.

public string $emptyIcon
#

the glyph icon toggle button "empty" state (example for null value)

the glyph icon toggle button "empty" state (example for null value)

public boolean $displayText
#

display button with text or only icon with label tooltip

display button with text or only icon with label tooltip

public boolean $sortable
#

whether the column is sortable. If so, the header cell will contain a link that may trigger the sorting. Defaults to true. Note that if WhToggleColumn::$name is not set, or if WhToggleColumn::$name is not allowed by CSort, this property will be treated as false.

whether the column is sortable. If so, the header cell will contain a link that may trigger the sorting. Defaults to true. Note that if WhToggleColumn::$name is not set, or if WhToggleColumn::$name is not allowed by CSort, this property will be treated as false.

See

WhToggleColumn::$name
public mixed $filter
#

the HTML code representing a filter input (eg a text field, a dropdown list) that is used for this data column. This property is effective only when CGridView::filter is set. If this property is not set, a text field will be generated as the filter input; If this property is an array, a dropdown list will be generated that uses this property value as the list options. If you don't want a filter for this data column, set this value to false.

the HTML code representing a filter input (eg a text field, a dropdown list) that is used for this data column. This property is effective only when CGridView::filter is set. If this property is not set, a text field will be generated as the filter input; If this property is an array, a dropdown list will be generated that uses this property value as the list options. If you don't want a filter for this data column, set this value to false.

Since

1.1.1
public string $toggleAction
#

Name of the action to call and toggle values

Name of the action to call and toggle values

See

bootstrap.action.TbToggleAction for an easy way to use with your controller
public string $afterToggle
#

a javascript function that will be invoked after the toggle ajax call.

The function signature is <span class="php-keyword1">function</span>(data)
  • success status of the ajax call, true if the ajax call was successful, false if the ajax call failed.
  • data the data returned by the server in case of a successful call or XHR object in case of error.
Note that if success is true it does not mean that the delete was successful, it only means that the ajax call was successful.

Example:

 array(
    class'=>'TbToggleColumn',
    'afterToggle'=>'function(success,data){ if (success) alert("Toggled successfuly"); }',
 ),

a javascript function that will be invoked after the toggle ajax call.

The function signature is <span class="php-keyword1">function</span>(data)
  • success status of the ajax call, true if the ajax call was successful, false if the ajax call failed.
  • data the data returned by the server in case of a successful call or XHR object in case of error.
Note that if success is true it does not mean that the delete was successful, it only means that the ajax call was successful.

Example:

 array(
    class'=>'TbToggleColumn',
    'afterToggle'=>'function(success,data){ if (success) alert("Toggled successfuly"); }',
 ),
public string $uniqueClassSuffix
#

suffix substituted to a name class of the tag <a>

suffix substituted to a name class of the tag <a>

protected array $toggleOptions
#

the configuration for toggle button.

the configuration for toggle button.

YiiWheels API documentation generated by ApiGen 2.8.0