PHP 클래스 TbEditableField

상속: extends CWidget
파일 보기 프로젝트 열기: yinhe/yincart

공개 프로퍼티들

프로퍼티 타입 설명
$apply whether to apply 'editable' js plugin to element. Only **safe** attributes become editable.
$attribute attribute name.
$combodate full config for **combodate** input. For details see http://vitalets.github.com/combodate/#docs
$cssFile for jQuery UI only. The theme CSS file name. By default Yii's jquery UI css used.
$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.
$display string Example:
'display' => 'js: function(value, sourceData) {
     var escapedValue = $("<div>").text(value).html();
     $(this).html("<b>"+escapedValue+"</b>");
}'
$emptytext text shown on empty field. If null - default X-editable value is used: Empty
$encode whether to HTML encode text on output
$format format to send date on server. If null - default X-editable value is used: yyyy-mm-dd.
$htmlOptions HTML options of element
$inputclass css class of input. If null - default X-editable value is used: input-medium
$mode mode of input: inline | popup. If not set - default X-editable value is used: popup.
$model ActiveRecord to be updated.
$onHidden string 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");
   }
}'
$onInit string A javascript function that will be invoked when editable element is initialized
$onSave string A javascript function that will be invoked when new value is saved Example:
'onSave' => 'js: function(e, params) {
    alert("Saved value: " + params.newValue);
}'
$onShown string 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.");
}'
$options all config options of x-editable. See full list here.
$params additional params to send on server
$parentid parent ID.
$placement placement of popup. Can be left, top, right, bottom. If null - default X-editable value is used: top
$select2 full config for **select2** input. For details see http://ivaynberg.github.com/select2
$source source data for **select**, **checklist**. Can be string (url) or array in format: array( array("value" => 1, "text" => "abc"), ...)
$success string Example:
'success' => 'js: function(response, newValue) {
    if (!response.success) return response.msg;
}'
$template template for **combodate** input. For details see http://vitalets.github.com/x-editable/docs.html#combodate.
$text text to be shown as element content
$theme for jQuery UI only. The JUI theme name.
$themeUrl for jQuery UI only. The root URL that contains JUI theme folders. If not set, default Yii's theme will be used.
$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.
$type type of editable widget. Can be text, textarea, select, date, checklist, etc.
$url url to submit value. Can be string or array containing Yii route, e.g. array('site/updateUser')
$validate string Example:
'validate' => 'js: function(value) {
    if ($.trim(value) == "") return "This field is required";
}'
$value initial value. If not set - will be taken from text
$viewformat format to display date in element. If null - equals to **format** option.
$viewseparator separator used to display tags.

공개 메소드들

메소드 설명
buildHtmlOptions ( ) * ### .buildHtmlOptions()
buildJsOptions ( )
getSelector ( ) * ### .getSelector()
init ( ) ### .init()
registerAssets ( ) * ### .registerAssets()
registerClientScript ( ) * ### .registerClientScript()
renderLink ( ) * ### .renderLink()
renderText ( ) * ### .renderText()
resolveModel ( $model, $attribute ) * ### .resolveModel()
run ( ) * ### .run()

보호된 메소드들

메소드 설명
registerJQueryUI ( ) ### .registerJQueryUI()

메소드 상세

buildHtmlOptions() 공개 메소드

* ### .buildHtmlOptions()
public buildHtmlOptions ( )

buildJsOptions() 공개 메소드

public buildJsOptions ( )

getSelector() 공개 메소드

* ### .getSelector()
public getSelector ( )

init() 공개 메소드

initialization of widget
public init ( )

registerAssets() 공개 메소드

* ### .registerAssets()
public registerAssets ( )

registerClientScript() 공개 메소드

* ### .registerClientScript()

registerJQueryUI() 보호된 메소드

method to register jQuery UI with build-in or custom theme
protected registerJQueryUI ( )

renderText() 공개 메소드

* ### .renderText()
public renderText ( )

resolveModel() 공개 정적인 메소드

check if attribute points to related model and resolve it
public static resolveModel ( $model, $attribute )
$model
$attribute

run() 공개 메소드

* ### .run()
public run ( )

프로퍼티 상세

$apply 공개적으로 프로퍼티

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

$attribute 공개적으로 프로퍼티

attribute name.
public $attribute

$combodate 공개적으로 프로퍼티

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

$cssFile 공개적으로 프로퍼티

for jQuery UI only. The theme CSS file name. By default Yii's jquery UI css used.
public $cssFile

$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.
public $disabled

$display 공개적으로 프로퍼티

Example:
'display' => 'js: function(value, sourceData) {
     var escapedValue = $("<div>").text(value).html();
     $(this).html("<b>"+escapedValue+"</b>");
}'
public string $display
리턴 string

$emptytext 공개적으로 프로퍼티

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

$encode 공개적으로 프로퍼티

whether to HTML encode text on output
public $encode

$format 공개적으로 프로퍼티

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

$htmlOptions 공개적으로 프로퍼티

HTML options of element
public $htmlOptions

$inputclass 공개적으로 프로퍼티

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

$mode 공개적으로 프로퍼티

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

$model 공개적으로 프로퍼티

ActiveRecord to be updated.
public $model

$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 string $onHidden
리턴 string

$onInit 공개적으로 프로퍼티

A javascript function that will be invoked when editable element is initialized
public string $onInit
리턴 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 $onSave
리턴 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 $onShown
리턴 string

$options 공개적으로 프로퍼티

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

$params 공개적으로 프로퍼티

additional params to send on server
public $params

$parentid 공개적으로 프로퍼티

parent ID.
public $parentid

$placement 공개적으로 프로퍼티

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

$select2 공개적으로 프로퍼티

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

$source 공개적으로 프로퍼티

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

$success 공개적으로 프로퍼티

Example:
'success' => 'js: function(response, newValue) {
    if (!response.success) return response.msg;
}'
public string $success
리턴 string

$template 공개적으로 프로퍼티

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

$text 공개적으로 프로퍼티

text to be shown as element content
public $text

$theme 공개적으로 프로퍼티

for jQuery UI only. The JUI theme name.
public $theme

$themeUrl 공개적으로 프로퍼티

for jQuery UI only. The root URL that contains JUI theme folders. If not set, default Yii's theme will be used.
public $themeUrl

$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.
public $title

$type 공개적으로 프로퍼티

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

$url 공개적으로 프로퍼티

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

$validate 공개적으로 프로퍼티

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

$value 공개적으로 프로퍼티

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

$viewformat 공개적으로 프로퍼티

format to display date in element. If null - equals to **format** option.
public $viewformat

$viewseparator 공개적으로 프로퍼티

separator used to display tags.
public $viewseparator