Class WhEditable
WhEditable class
Creates editable element on page (without linking to model attribute)
- CWidget
-
WhEditable
Direct known subclasses
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
|
|
public
|
|
public
|
|
public
string
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
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 |
public static
array
|
|
public static
|
Magic methods summary
Properties summary
public
string
|
$type |
#
type of editable widget. Can be |
public
string
|
$url |
#
url to submit value. Can be string or array containing Yii route, e.g.
|
public
mixed
|
$pk |
#
primary key |
public
string
|
$name |
#
name of field |
public
array
|
$params |
#
additional params to send on server |
public
string
|
$inputclass |
#
css class of input. If |
public
string
|
$mode |
#
mode of input: |
public
string
|
$text |
#
text to be shown as element content |
public
mixed
|
$value |
#
initial value. If not set - will be taken from text |
public
string
|
$placement |
#
placement of popup. Can be |
public
string
|
$emptytext |
#
text shown on empty field. If |
public
string
|
$showbuttons |
#
visibility of buttons. Can be boolean |
public
string
|
$send |
#
Strategy for sending data on server. Can be |
public
boolean
|
$disabled |
#
will editable be initially disabled. It means editable plugin will be applied
to element, but you should call |
public
mixed
|
$source |
#
source data for select, checklist. Can be string (url) or array in format: array( array("value" => 1, "text" => "abc"), ...) |
public
string
|
$format |
#
format to send date on server. If |
public
string
|
$viewformat |
#
format to display date in element. If |
public
string
|
$template |
#
template for combodate input. For details see http://vitalets.github.com/x-editable/docs.html#combodate. |
public
array
|
$combodate |
#
full config for combodate input. For details see http://vitalets.github.com/combodate/#docs |
public
string
|
$viewseparator |
#
separator used to display tags. |
public
array
|
$select2 |
#
full config for select2 input. For details see http://ivaynberg.github.com/select2 |
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"; }' |
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; }' |
public
string
|
$display |
#
A javascript function that will be invoked to custom display value. Example: 'display' => 'js: function(value, sourceData) { var escapedValue = $("<div>").text(value).html(); $(this).html("<b>"+escapedValue+"</b>"); }' |
public
string
|
$liveTarget |
#
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 |
public
string
|
$onInit |
#
A javascript function that will be invoked when editable element is initialized |
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."); }' |
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); }' |
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"); } }' |
public
array
|
$options | |
public
array
|
$htmlOptions |
#
HTML options of element. In |
public
boolean
|
$encode |
#
whether to HTML encode text on output |
public
boolean
|
$apply |
#
whether to apply 'editable' js plugin to element. Only safe attributes become editable. |
public
string
|
$title |
#
title of popup. If |
public
string
|
$theme |
#
for jQuery UI only. The JUI theme name. |
protected
boolean
|
$_prepareToAutotext |