YiiWheels
  • Package
  • Class
  • Tree

Packages

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

Classes

  • WhEditable
  • WhEditableColumn
  • WhEditableDetailView
  • WhEditableField
  • WhEditableSaver

Class WhEditable

WhEditable class

Creates editable element on page (without linking to model attribute)

CWidget
Extended by WhEditable

Direct known subclasses

WhEditableField

Package: YiiWheels\widgets\editable
Copyright: Copyright © 2amigos.us 2013-
Copyright: Copyright © Vitaliy Potapov 2012
License: New BSD License
Author: Antonio Ramirez <amigo.cobos@gmail.com>
Author: Vitaliy Potapov <noginsk@rambler.ru>
Version: 1.3.1
Link: https://github.com/vitalets/x-editable-yii
Located at widgets/editable/WhEditable.php

Methods summary

public
# init( )

initialization of widget

initialization of widget

public
# buildHtmlOptions( )

Builds html options

Builds html options

public
# buildJsOptions( )

Builds javascript options

Builds javascript options

public string
# registerClientScript( )

Registers client script

Registers client script

Returns

string
public
# registerAssets( )

Registers assets

Registers assets

Throws

CException
public
# run( )

Widget run method

Widget run method

public
# renderLink( )

Renders a link

Renders a link

public
# renderText( )

Renders text

Renders text

public null|string
# getSelector( )

Returns the plugin selector

Returns the plugin selector

Returns

null|string
public static boolean
# isAutotext( mixed $options, mixed $type )

Returns is autotext should be applied to widget: e.g. for 'select' to display text for id

Returns is autotext should be applied to widget: e.g. for 'select' to display text for id

Parameters

$options
mixed
$options
$type
mixed
$type

Returns

boolean
public static array
# source( mixed $models, mixed $valueField = '', mixed $textField = '', mixed $groupField = '', mixed $groupTextField = '' )

Returns php-array as valid x-editable source in format: [{value: 1, text: 'text1'}, {...}]

Returns php-array as valid x-editable source in format: [{value: 1, text: 'text1'}, {...}]

See https://github.com/vitalets/x-editable-yii/issues/37

Parameters

$models
mixed
$models
$valueField
mixed
$valueField
$textField
mixed
$textField
$groupField
mixed
$groupField
$groupTextField
mixed
$groupTextField

Returns

array
public static
# attachAjaxUpdateEvent( mixed $widget )

injects ajaxUpdate event into widget

injects ajaxUpdate event into widget

Parameters

$widget
mixed
$widget

Magic methods summary

Properties summary

public string $type
#

type of editable widget. Can be text, textarea, select, date, checklist, etc.

type of editable widget. Can be text, textarea, select, date, checklist, etc.

See

x-editable
public string $url
#

url to submit value. Can be string or array containing Yii route, e.g. array('site/updateUser')

url to submit value. Can be string or array containing Yii route, e.g. array('site/updateUser')

See

x-editable
public mixed $pk
#

primary key

primary key

See

x-editable
public string $name
#

name of field

name of field

See

x-editable
public array $params
#

additional params to send on server

additional params to send on server

See

x-editable
public string $inputclass
#

css class of input. If null - default X-editable value is used: input-medium

css class of input. If null - default X-editable value is used: input-medium

See

x-editable
public string $mode
#

mode of input: inline | popup. If not set - default X-editable value is used: popup.

mode of input: inline | popup. If not set - default X-editable value is used: popup.

See

x-editable
public string $text
#

text to be shown as element content

text to be shown as element content

public mixed $value
#

initial value. If not set - will be taken from text

initial value. If not set - will be taken from text

See

x-editable
public string $placement
#

placement of popup. Can be left, top, right, bottom. If null - default X-editable value is used: top

placement of popup. Can be left, top, right, bottom. If null - default X-editable value is used: top

See

x-editable
public string $emptytext
#

text shown on empty field. If null - default X-editable value is used: Empty

text shown on empty field. If null - default X-editable value is used: Empty

See

x-editable
public string $showbuttons
#

visibility of buttons. Can be boolean false|true or string bottom.

visibility of buttons. Can be boolean false|true or string bottom.

See

x-editable
public string $send
#

Strategy for sending data on server. Can be auto|always|never. When 'auto' data will be sent on server only if pk and url defined, otherwise new value will be stored locally.

Strategy for sending data on server. Can be auto|always|never. When 'auto' data will be sent on server only if pk and url defined, otherwise new value will be stored locally.

See

x-editable
public boolean $disabled
#

will editable be initially disabled. It means editable plugin will be applied to element, but you should call .editable('enable') method to activate it. To totally disable applying 'editable' to element use apply option.

will editable be initially disabled. It means editable plugin will be applied to element, but you should call .editable('enable') method to activate it. To totally disable applying 'editable' to element use apply option.

See

x-editable
public mixed $source
#

source data for select, checklist. Can be string (url) or array in format: array( array("value" => 1, "text" => "abc"), ...)

source data for select, checklist. Can be string (url) or array in format: array( array("value" => 1, "text" => "abc"), ...)

See

x-editable
public string $format
#

format to send date on server. If null - default X-editable value is used: yyyy-mm-dd.

format to send date on server. If null - default X-editable value is used: yyyy-mm-dd.

See

x-editable
public string $viewformat
#

format to display date in element. If null - equals to format option.

format to display date in element. If null - equals to format option.

See

x-editable
public string $template
#

template for combodate input. For details see http://vitalets.github.com/x-editable/docs.html#combodate.

template for combodate input. For details see http://vitalets.github.com/x-editable/docs.html#combodate.

See

x-editable
public array $combodate
#

full config for combodate input. For details see http://vitalets.github.com/combodate/#docs

full config for combodate input. For details see http://vitalets.github.com/combodate/#docs

See

x-editable
public string $viewseparator
#

separator used to display tags.

separator used to display tags.

See

x-editable
public array $select2
#

full config for select2 input. For details see http://ivaynberg.github.com/select2

full config for select2 input. For details see http://ivaynberg.github.com/select2

See

x-editable
public string $validate
#

A javascript function that will be invoked to validate value. Example:

'validate' => 'js: function(value) {
    if($.trim(value) == "") return "This field is required";
}'

A javascript function that will be invoked to validate value. Example:

'validate' => 'js: function(value) {
    if($.trim(value) == "") return "This field is required";
}'

See

x-editable

Example

public string $success
#

A javascript function that will be invoked to process successful server response. Example:

'success' => 'js: function(response, newValue) {
    if(!response.success) return response.msg;
}'

A javascript function that will be invoked to process successful server response. Example:

'success' => 'js: function(response, newValue) {
    if(!response.success) return response.msg;
}'

See

x-editable
public string $display
#

A javascript function that will be invoked to custom display value. Example:

'display' => 'js: function(value, sourceData) {
     var escapedValue = $("&lt;div&gt;").text(value).html();
     $(this).html("&lt;b&gt;"+escapedValue+"&lt;/b&gt;");
}'

A javascript function that will be invoked to custom display value. Example:

'display' => 'js: function(value, sourceData) {
     var escapedValue = $("&lt;div&gt;").text(value).html();
     $(this).html("&lt;b&gt;"+escapedValue+"&lt;/b&gt;");
}'

See

x-editable
public string $liveTarget
#

DOM id of target where afterAjaxUpdate handler will call live update of editable element

DOM id of target where afterAjaxUpdate handler will call live update of editable element

public string $liveSelector
#

jQuery selector of elements to wich will be applied editable. Usefull in combination of liveTarget when you want to keep field(s) editble after ajaxUpdate

jQuery selector of elements to wich will be applied editable. Usefull in combination of liveTarget when you want to keep field(s) editble after ajaxUpdate

public string $onInit
#

A javascript function that will be invoked when editable element is initialized

A javascript function that will be invoked when editable element is initialized

See

x-editable
public string $onShown
#

A javascript function that will be invoked when editable form is shown Example:

'onShown' => 'js: function() {
    var $tip = $(this).data("editableContainer").tip();
    $tip.find("input").val("overwriting value of input.");
}'

A javascript function that will be invoked when editable form is shown Example:

'onShown' => 'js: function() {
    var $tip = $(this).data("editableContainer").tip();
    $tip.find("input").val("overwriting value of input.");
}'

See

x-editable
public string $onSave
#

A javascript function that will be invoked when new value is saved Example:

'onSave' => 'js: function(e, params) {
    alert("Saved value: " + params.newValue);
}'

A javascript function that will be invoked when new value is saved Example:

'onSave' => 'js: function(e, params) {
    alert("Saved value: " + params.newValue);
}'

See

x-editable
public string $onHidden
#

A javascript function that will be invoked when editable form is hidden Example:

'onHidden' => 'js: function(e, reason) {
   if(reason === "save" || reason === "cancel") {
       //auto-open next editable
       $(this).closest("tr").next().find(".editable").editable("show");
   }
}'

A javascript function that will be invoked when editable form is hidden Example:

'onHidden' => 'js: function(e, reason) {
   if(reason === "save" || reason === "cancel") {
       //auto-open next editable
       $(this).closest("tr").next().find(".editable").editable("show");
   }
}'

See

x-editable
public array $options
#

all config options of x-editable. See full list here.

all config options of x-editable. See full list here.

public array $htmlOptions
#

HTML options of element. In EditableColumn htmlOptions are PHP expressions so you can use $data to bind values to particular cell, e.g. 'data-categoryID' => '$data->categoryID'.

HTML options of element. In EditableColumn htmlOptions are PHP expressions so you can use $data to bind values to particular cell, e.g. 'data-categoryID' => '$data->categoryID'.

public boolean $encode
#

whether to HTML encode text on output

whether to HTML encode text on output

public boolean $apply
#

whether to apply 'editable' js plugin to element. Only safe attributes become editable.

whether to apply 'editable' js plugin to element. Only safe attributes become editable.

public string $title
#

title of popup. If null - will be generated automatically from attribute label. Can have token {label} inside that will be replaced with actual attribute label.

title of popup. If null - will be generated automatically from attribute label. Can have token {label} inside that will be replaced with actual attribute label.

public string $theme
#

for jQuery UI only. The JUI theme name.

for jQuery UI only. The JUI theme name.

protected boolean $_prepareToAutotext
#
YiiWheels API documentation generated by ApiGen 2.8.0