Registers the client scripts for the button column.
771341
protected function registerClientScript()
	{
		$js=array();
		foreach($this->buttons as $id=>$button)
		{
			if(isset($button['click']))
			{
				$function=CJavaScript::encode($button['click']);
				$class=preg_replace('/\s+/','.',$button['options']['class']);
				$js[]="jQuery(document).on('click','#{$this->grid->id} a.{$class}',$function);";
			}
		}

		if($js!==array())
			Yii::app()->getClientScript()->registerScript(__CLASS__.'#'.$this->id, implode("\n",$js));
	}
1359852
protected function registerScript()
    {
        $id = $this->options['id'];
        $clientOptions = (count($this->clientOptions)) ? Json::encode($this->clientOptions) : '{}';

        $this->getView()->registerJs("CKEDITOR.replace('$id', $clientOptions);", View::POS_END);
    }
882549
public function registerClientScript()
    {
        $this->options['element'] = new JsExpression("jQuery('#{$this->options['id']}')[0]");
        $mdeOptions = Json::encode($this->mdeOptions);
        $mdeName = Inflector::classify('editor' . $this->options['id']);
        $js = "var {$mdeName} = new SimpleMDE({$mdeOptions});";
        $this->getView()->registerJs($js);
    }
1013609
public function registerClientScript()
    {
        $path = __DIR__ . DIRECTORY_SEPARATOR . 'assets';
        $assetsUrl = $this->getAssetsUrl($path);

        /** @var $cs CClientScript */
        $cs = Yii::app()->getClientScript();
        $cs->registerCssFile($assetsUrl . '/css/bootstrap-relational.css');

        if ($this->afterAjaxUpdate !== null) {
            if ((!$this->afterAjaxUpdate instanceof CJavaScriptExpression) && strpos(
                    $this->afterAjaxUpdate,
                    'js:'
                ) !== 0
            )
                $this->afterAjaxUpdate = new CJavaScriptExpression($this->afterAjaxUpdate);
        } else
            $this->afterAjaxUpdate = 'js:$.noop';

        $this->ajaxErrorMessage = CHtml::encode($this->ajaxErrorMessage);
        $afterAjaxUpdate = CJavaScript::encode($this->afterAjaxUpdate);
        $span = count($this->grid->columns);
        $loadingPic = CHtml::image(Yii::app()->yiiwheels->getAssetsUrl() . '/img/loading.gif');
        $cache = $this->cacheData ? 'true' : 'false';
        $data = !empty($this->submitData) && is_array(
            $this->submitData
        ) ? $this->submitData : 'js:{}';
        $data = CJavascript::encode($data);

        $js = <<<EOD
$(document).on('click','.{$this->cssClass}', function(){
	var span = $span;
	var that = $(this);
	var status = that.data('status');
	var rowid = that.data('rowid');
	var tr = $('#relatedinfo'+rowid);
	var parent = that.parents('tr').eq(0);
	var afterAjaxUpdate = {$afterAjaxUpdate};

	if (status && status=='on'){return}
	that.data('status','on');

	if (tr.length && !tr.is(':visible') && {$cache})
	{
		tr.slideDown();
		that.data('status','off');
		return;
	}else if (tr.length && tr.is(':visible'))
	{
		tr.slideUp();
		that.data('status','off');
		return;
	}
	if (tr.length)
	{
		tr.find('td').html('{$loadingPic}');
		if (!tr.is(':visible')){
			tr.slideDown();
		}
	}
	else
	{
		var td = $('<td/>').html('{$loadingPic}').attr({'colspan':$span});
		tr = $('<tr/>').prop({'id':'relatedinfo'+rowid}).append(td);
		/* we need to maintain zebra styles :) */
		var fake = $('<tr class="hide"/>').append($('<td/>').attr({'colspan':$span}));
		parent.after(tr);
		tr.after(fake);
	}
	var data = $.extend({$data}, {id:rowid});
	$.ajax({
		url: '{$this->url}',
		data: data,
		success: function(data){
			tr.find('td').html(data);
			that.data('status','off');
			if ($.isFunction(afterAjaxUpdate))
			{
				afterAjaxUpdate(tr,rowid,data);
			}
		},
		error: function()
		{
			tr.find('td').html('{$this->ajaxErrorMessage}');
			that.data('status','off');
		}
	});
});
EOD;
        $cs->registerScript(__CLASS__ . '#' . $this->id, $js);
    }
500427
public function registerClientScript() {
		
        Booster::getBooster()->registerAssetCss('bootstrap-relational.css');

		/** @var $cs CClientScript */
		$cs = Yii::app()->getClientScript();
		if ($this->afterAjaxUpdate !== null) {
			if ((!$this->afterAjaxUpdate instanceof CJavaScriptExpression)
				&& (strpos($this->afterAjaxUpdate,'js:') !== 0)
			) {
				$this->afterAjaxUpdate = new CJavaScriptExpression($this->afterAjaxUpdate);
			}
		} else {
			$this->afterAjaxUpdate = 'js:$.noop';
		}

		$this->ajaxErrorMessage = CHtml::encode($this->ajaxErrorMessage);
		$afterAjaxUpdate = CJavaScript::encode($this->afterAjaxUpdate);
		$span = count($this->grid->columns);
		$loadingPic = CHtml::image(Booster::getBooster()->getAssetsUrl() . '/img/loading.gif');
		$cache = $this->cacheData ? 'true' : 'false';
		$data = !empty($this->submitData) && is_array($this->submitData) ? $this->submitData : 'js:{}';
		$data = CJavascript::encode($data);
		list($parentId) = explode('_',$this->id);
		$_id = $this->cssClass.'_'.$this->id;
		$js = <<<EOD
$(document).on('click','#{$parentId} .{$_id}', function() {
	var span = $span;
	var that = $(this);
	var status = that.data('status');
	var rowid = that.data('rowid');
	var colid = that.data('colid');
	var tr = $('#relatedinfo'+rowid+colid);
	var parent = that.parents('tr').eq(0);
	var afterAjaxUpdate = {$afterAjaxUpdate};

	if (status && status=='on'){return}
	that.data('status','on');

	if (tr.length && !tr.is(':visible') && {$cache})
	{
		$("tr[id^=relatedinfo"+rowid+"]").not(tr).hide(); // .slideUp();
		tr.slideDown();
		that.data('status','off');
		return;
	}else if (tr.length && tr.is(':visible'))
	{
		tr.slideUp();
		that.data('status','off');
		return;
	}
	if (tr.length)
	{
		$("tr[id^=relatedinfo"+rowid+"]").not(tr).hide(); // .slideUp();
		tr.find('td').html('{$loadingPic}');
		if (!tr.is(':visible')){
			tr.slideDown();
		}
	}
	else
	{
		$("tr[id^=relatedinfo"+rowid+"]").hide(); // .slideUp();
		var td = $('<td/>').html('{$loadingPic}').attr({'colspan':$span});
		tr = $('<tr/>').prop({'id':'relatedinfo'+rowid+colid}).append(td);
		/* we need to maintain zebra styles :) */
		var fake = $('<tr class="hide"/>').append($('<td/>').attr({'colspan':$span}));
		parent.after(tr);
		tr.after(fake);
	}
	var data = $.extend({$data}, {id:rowid});
	$.ajax({
		url: '{$this->url}',
		data: data,
		success: function(data){
			tr.find('td').html(data);
			that.data('status','off');
			if ($.isFunction(afterAjaxUpdate))
			{
				afterAjaxUpdate(tr,rowid,data);
			}
		},
		error: function()
		{
			tr.find('td').html('{$this->ajaxErrorMessage}');
			that.data('status','off');
		}
	});
});
EOD;
		$cs->registerScript(__CLASS__ . '#' . $this->id, $js);
	}
727113
public function registerClientScript()
	{
		$id = $this->getId();
		$jsData = CJavaScript::jsonEncode($this->data);
		$jsOptions = CJavaScript::jsonEncode($this->options);

		$script = '
			google.setOnLoadCallback(drawChart' . $id . ');
			var ' . $id . '=null;
			function drawChart' . $id . '() {
				var data = google.visualization.arrayToDataTable(' . $jsData . ');

				var options = ' . $jsOptions . ';

				' . $id . ' = new google.visualization.' . $this->visualization . '(document.getElementById("' . $this->containerId . '"));
				' . $id . '.draw(data, options);
			}';

		/** @var $cs CClientScript */
		$cs = Yii::app()->getClientScript();
		$cs->registerScriptFile('https://www.google.com/jsapi');
		$cs->registerScript(
			__CLASS__ . '#' . $id,
			'google.load("visualization", "1", {packages:["corechart"]});',
			CClientScript::POS_HEAD
		);
		$cs->registerScript($id, $script, CClientScript::POS_HEAD);
	}
661555
public function registerClientScript()
    {
        $js = [];
        $view = $this->getView();
        DateTimePickerAsset::register($view);
        $id = $this->options['id'];
        $selector = ";jQuery('#$id')";

        if (strpos($this->template, '{button}') !== false || $this->inline) {
            $selector .= ".parent()";
        }

        $options = !empty($this->clientOptions) ? Json::encode($this->clientOptions) : '';

        $js[] = "$selector.datetimepicker($options);";

        if ($this->inline) {
            $js[] = "$selector.find('.datetimepicker-inline').addClass('center-block');";
            $js[] = "$selector.find('table.table-condensed').attr('align','center').css('margin','auto');";
        }
        if (!empty($this->clientEvents)) {
            foreach ($this->clientEvents as $event => $handler) {
                $js[] = "$selector.on('$event', $handler);";
            }
        }
        $view->registerJs(implode("\n", $js), $view::POS_READY);
    }
100218
public function registerClientScript()
    {
        $options = $this->getClientOptions();
        $this->_hashOptions = $this->_pluginName . '_' . hash('crc32', serialize($options));
        $id = $this->options['id'];
        $view = $this->getView();
        $view->registerJs("var {$this->_hashOptions} = {$options};\nvar calendar_{$this->options['id']};", $view::POS_HEAD);
        $js = "calendar_{$this->options['id']} = jQuery(\"#{$id}\").fullCalendar({$this->_hashOptions});";
        $asset = FullCalendarAsset::register($view);
        if (isset($this->config['lang'])) {
            $asset->language = $this->config['lang'];
        }
        if ($this->googleCalendar) {
            $asset->googleCalendar = $this->googleCalendar;
        }
        $view->registerJs($js);
    }
802405
public function registerClientScript()
    {
        Html::addCssClass($this->wrapperOptions, "upload-kit");
        UploadAsset::register($this->getView());
        if ($this->sortable) {
            JuiAsset::register($this->getView());
        }
        $options = Json::encode($this->clientOptions);
        $this->getView()->registerJs("jQuery('#{$this->fileInputName}').attachmentUpload({$options});");
    }
957284
public function registerClientScript()
	{
		/** @var $cs CClientScript */
		$cs = Yii::app()->getClientScript();

		$cs->registerPackage('picker');

		$pickerOptions = CJavaScript::encode($this->pickerOptions);
		$gridId = $this->grid->id;
		$class = preg_replace('/\s+/', '.', $this->class);

		// Registering script to properly open *only* the picker for which corresponding toggler was clicked,
		// and close all other pickers.
		$cs->registerScript(
			__CLASS__ . '#' . $this->id,
			<<<ENDL
$(document).on('click','#{$gridId} a.{$class}', function() {
	if ($(this).hasClass('pickeron')) {
		$(this).removeClass('pickeron').picker('toggle');
		return;
	}
	$('#{$gridId} a.pickeron')
		.removeClass('pickeron')
		.each(function (i, elem) {
			$(elem).picker('toggle');
		});
	$(this)
		.picker({$pickerOptions})
		.picker('toggle').addClass('pickeron'); return false;
});
ENDL
		);
	}
426937
protected function registerClientScript()
    {
        $id = $this->options['id'];
        $view = $this->getView();
        $option = !empty($this->pluginOptions['option']) ? Json::encode($this->pluginOptions['option']) : '{}';

        if ($this->theme) {
            $js = "var {$this->clientId} = echarts.init(document.getElementById('{$id}'), " . $this->quote($this->theme) . ");";
        } else {
            $js = "var {$this->clientId} = echarts.init(document.getElementById('{$id}'));";
        }
        $js .= "{$this->clientId}.setOption({$option});";
        if (isset($this->pluginOptions['group'])) {
            $js .= "{$this->clientId}.group = " . $this->quote($this->pluginOptions['group']) . ";";
        }
        if ($this->responsive) {
            $js .= "$(window).resize(function () {{$this->clientId}.resize()});";
        }
        foreach ($this->pluginEvents as $name => $handlers) {
            $handlers = (array) $handlers;
            foreach ($handlers as $handler) {
                $js .= "{$this->clientId}.on(" . $this->quote($name) . ", $handler);";
            }
        }

        EChartsAsset::register($view);
        $view->registerJs($js);
    }
1292141
public function registerClientScript() {
        $view = $this->getView();
        $assetBundle = $this->assetBundle instanceof AssetBundle ? $this->assetBundle : Asset::register($view);

        if (array_key_exists('language', $this->options) && $this->options['language'] !== null) {
            $assetBundle->language = $this->options['language'];
        }

        $selector = $this->selector === null ? '#' . $this->htmlOptions['id'] : $this->selector;
        $options = Json::encode($this->options);

        $view->registerJs("jQuery('$selector').gtreetable($options);");
    }
358925
public function registerClientScript()
    {
        $view = $this->getView();
        TagsinputAsset::register($view);
        $clientOptions = Json::encode($this->clientOptions);
        $view->registerJs("jQuery(\"#{$this->options['id']}\").tagsinput({$clientOptions});");
    }
243813
public function registerClientScript()
    {
        /* publish assets dir */
        $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets';
        $assetsUrl = $this->getAssetsUrl($path);

        /* @var $cs CClientScript */
        $cs = Yii::app()->getClientScript();

        $script = $this->debugMode
            ? 'jquery.sparkline.js'
            : 'jquery.sparkline.min.js';

        $cs->registerScriptFile($assetsUrl . '/js/' . $script);

        /* initialize plugin */
        $selector = '#' . TbArray::getValue('id', $this->htmlOptions, $this->getId());

        $data = CJavaScript::encode($this->data);
        $options = CJavaScript::encode($this->pluginOptions);

        $cs->registerScript(__CLASS__ . '#' . $selector, "jQuery('{$selector}').sparkline({$data}, {$options});");
    }
206967
public function registerClientScript()
    {
        /* publish assets dir */
        $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets';
        $assetsUrl = $this->getAssetsUrl($path);

        /* @var $cs CClientScript */
        $cs = Yii::app()->getClientScript();

        $cs->registerScriptFile($assetsUrl . '/js/jquery.mask.js');

        /* initialize plugin */
        $selector = '#' . TbArray::getValue('id', $this->htmlOptions, $this->getId());

        $options = !empty($this->pluginOptions) ? CJavaScript::encode($this->pluginOptions) : '{}';
        $script = "jQuery('{$selector}').mask('{$this->mask}',{$options});";
        Yii::app()->clientScript->registerScript((uniqid(__CLASS__ . '#', true)), $script, CClientScript::POS_END);
    }
735986
public function registerClientScript()
	{
		$id=$this->htmlOptions['id'];

		$options=$this->getClientOptions();
		$options=$options===array()? '' : CJavaScript::encode($options);

		$cs=Yii::app()->getClientScript();
		$cs->registerCoreScript('multifile');
		$cs->registerScript('Yii.CMultiFileUpload#'.$id,"jQuery(\"#{$id}\").MultiFile({$options});");
	}
366587
public function registerClientScript()
    {
        $view = $this->view;
        ToggleAsset::register($view);
        //$this->clientOptions['animate'] = ArrayHelper::getValue($this->clientOptions, 'animate', true);
        $options = Json::encode($this->options);
        $js[] = "jQuery('$this->selector').bootstrapToggle($options);";
        if (!empty($this->clientEvents)) {
            foreach ($this->clientEvents as $event => $handler) {
                $js[] = "jQuery('$this->selector').on('$event', $handler);";
            }
        }
        $view->registerJs(implode("\n", $js));
    }