75 if (Yii::getPathOfAlias(
'jqgrid') ===
false)
76 Yii::setPathOfAlias(
'jqgrid', realpath(dirname(__FILE__) .
'/'));
78 if ($this->coreCss !==
false)
81 if ($this->coreJs !==
false)
98 Yii::app()->getClientScript()->registerCssFile($this->
getAssetsUrl() .
"/css/{$cssFile}", $media);
113 public function registerJS($jsFile, $position = CClientScript::POS_HEAD) {
115 $cs = Yii::app()->getClientScript();
116 $cs->registerCoreScript(
'jquery');
117 $cs->registerCoreScript(
'jquery.ui');
118 $cs->registerScriptFile($this->
getAssetsUrl() .
"/js/{$jsFile}", $position);
122 $id = $this->getId();
123 if (isset($this->htmlOptions[
'id']))
124 $id = $this->htmlOptions[
'id'];
126 $this->htmlOptions[
'id'] = $id;
127 echo
'<table id="'.$id.
'"></table>';
128 echo
'<div id="pager"></div>';
129 $options = CJavaScript::encode($this->options);
131 $cs = Yii::app()->getClientScript();
132 $cs->registerScript(__CLASS__ .
'#' . $id,
"$(function(){jQuery('#{$id}').jqGrid($options);})", CClientScript::POS_HEAD);
133 $cs->registerScriptFile($this->
getAssetsUrl() .
'/js/i18n/grid.locale-' . $this->language .
'.js', CClientScript::POS_HEAD);
141 if (isset($this->_assetsUrl))
144 $assetsPath = Yii::getPathOfAlias(
'jqgrid.assets');
145 $assetsUrl = Yii::app()->assetManager->publish($assetsPath,
false, -1, $this->forceCopyAssets);
146 return $this->_assetsUrl = $assetsUrl;