本文整理汇总了PHP中CDataColumn::init方法的典型用法代码示例。如果您正苦于以下问题:PHP CDataColumn::init方法的具体用法?PHP CDataColumn::init怎么用?PHP CDataColumn::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDataColumn
的用法示例。
在下文中一共展示了CDataColumn::init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
parent::init();
$this->addPocketData();
$this->removeFromData();
$this->grid->onRegisterScript = array($this, 'registerScript');
}
示例2: init
/**
* Initializes the column.
*
* @see CDataColumn::init()
*/
public function init()
{
parent::init();
if (!isset($this->htmlCheckBoxOptions['class'])) {
$this->htmlCheckBoxOptions['class'] = 'checkBoxColumn-' . $this->id;
}
$cs = Yii::app()->getClientScript();
$gridId = $this->grid->getId();
$script = '
jQuery(".' . $this->htmlCheckBoxOptions['class'] . '").live("click", function(e){
$.ajax({
type: "POST",
dataType: "json",
cache: false,
url: "' . (is_array($this->actionUrl) ? CHtml::normalizeUrl($this->actionUrl) : $this->actionUrl) . '",
data: {
attr: "' . $this->name . '",
model: "' . get_class($this->grid->filter) . '",
item: $(this).attr("itemid"),
checked: $(this).attr("checked")?1:0
},
success: function(data){
//alert();
$("#' . $gridId . '").yiiGridView.update("' . $gridId . '");
}
});
});';
$cs->registerScript(__CLASS__ . $gridId . '#active_column-' . $this->id, $script);
}
示例3: init
/**
* Initializes the column.
*
* @see CDataColumn::init()
*/
public function init()
{
parent::init();
if (!isset($this->selectBoxHtmlOptions['class'])) {
$this->selectBoxHtmlOptions['class'] = 'selectColumn-' . $this->id;
}
$cs = Yii::app()->getClientScript();
$gridId = $this->grid->getId();
$script = '
jQuery(".' . $this->selectBoxHtmlOptions['class'] . '").live("change", function(e){
e.preventDefault();
$.ajax({
type: "POST",
dataType: "json",
cache: false,
url: "' . (is_array($this->actionUrl) ? CHtml::normalizeUrl($this->actionUrl) : $this->actionUrl) . '",
data: {
item: $(this).attr("itemId"),
value:$("option:selected",this).val()
},
success: function(data){
$("#' . $gridId . '").yiiGridView.update("' . $gridId . '");
}
});
});';
$cs->registerScript(__CLASS__ . $gridId . '#active_column-' . $this->id, $script);
}
示例4: init
public function init()
{
parent::init();
$this->assets = Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias($this->assets)) . '/publishedColumn';
$this->initVariables();
$this->grid->onRegisterScript = array($this, 'registerScript');
}
示例5: init
/**
* Initializes the column.
*/
public function init()
{
parent::init();
if ($this->name === null && $this->value === null) {
throw new CException(Yii::t('zii', 'Either "name" or "value" must be specified for CEditableColumn.'));
}
}
示例6: renderHeaderCellContent
protected function renderHeaderCellContent()
{
$this->registerScripts();
if ($this->headerText != null)
echo $this->headerText;
else
parent::init();
}
示例7: init
public function init()
{
if ($this->url == null) {
$this->url = '/' . preg_replace('#' . Yii::app()->controller->action->id . '$#', 'sortable', Yii::app()->controller->route);
}
$this->registerScripts();
parent::init();
}
示例8: init
/**
* Initialises the column.
* Sets the initial value for the total.
*/
public function init()
{
parent::init();
if (is_string($this->init)) {
$this->init = $this->evaluateExpression($this->init);
}
$this->_total = $this->init;
$this->_sortDesc = !empty($this->sort) && $this->grid->dataProvider->getSort()->getDirection($this->sort);
}
示例9: init
public function init()
{
if (!$this->name) {
throw new CException('You should provide name for EditableColumn');
}
parent::init();
//need to attach ajaxUpdate handler to refresh editables on pagination and sort
WhEditable::attachAjaxUpdateEvent($this->grid);
}
示例10: init
/**
* Initializes the column.
*/
public function init()
{
if (isset($this->headerHtmlOptions['class'])) {
$this->headerHtmlOptions['class'] .= ' header';
} else {
$this->headerHtmlOptions['class'] = 'header';
}
parent::init();
}
示例11: init
public function init()
{
parent::init();
if ($this->onButtonImageUrl === null)
$this->onButtonImageUrl = Yii::app()->assetManager->publish(Yii::getPathOfAlias('application.widgets.assets.gridview').'/check_icon.png');
if ($this->offButtonImageUrl === null)
$this->offButtonImageUrl = Yii::app()->assetManager->publish(Yii::getPathOfAlias('application.widgets.assets.gridview').'/uncheck_icon.png');
$this->registerClientScript();
}
示例12: init
public function init()
{
// allows width to be set for column using width property
if ($this->width) {
$this->headerHtmlOptions['style'] = isset($this->headerHtmlOptions['style']) ? $this->headerHtmlOptions['style'] : '';
$this->htmlOptions['style'] = isset($this->htmlOptions['style']) ? $this->htmlOptions['style'] : '';
$this->headerHtmlOptions['style'] .= 'width: ' . $this->width . ';';
$this->htmlOptions['style'] .= 'width: ' . $this->width . ';';
}
return parent::init();
}
示例13: init
public function init()
{
if (!$this->grid->dataProvider instanceof CActiveDataProvider) {
throw new CException(Yii::t('zii', 'TbEditableColumn can be applied only to grid based on CActiveDataProvider'));
}
if (!$this->name) {
throw new CException(Yii::t('zii', 'You should provide name for TbEditableColumn'));
}
parent::init();
if ($this->isEditable($this->grid->dataProvider->model)) {
$this->attachAjaxUpdateEvent();
}
}
示例14: init
public function init()
{
if (!$this->grid->dataProvider instanceof CActiveDataProvider) {
throw new CException('EditableColumn can be applied only to grid based on CActiveDataProvider');
}
if (!$this->name) {
throw new CException('You should provide name for EditableColumn');
}
parent::init();
//need to attach ajaxUpdate handler to refresh editables on pagination and sort
//should be here, before render of grid js
$this->attachAjaxUpdateEvent();
}
示例15: init
public function init()
{
parent::init();
//$this->visible = false;//didnt work
//$this->header = '';
//if($this->name=='active'||$this->name=='created_on'||$this->name=='created_by'){
if ($this->name == 'created_on' || $this->name == 'created_by') {
$this->htmlOptions = array('class' => 'debug');
$this->headerHtmlOptions = array('class' => 'debug');
$this->footerHtmlOptions = array('class' => 'debug');
$this->filterHtmlOptions = array('class' => 'debug');
}
}