Hello,
Sorry for my english.
I have a error using jqGrid and rendering a example too. I don’t know if both errors are related.
FIRST ERROR:
I have installed this extension (downloaded of the svn repository) using this config:
My main.php
Yii::setPathOfAlias( 'pogostick', dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.'\extensions\pogostick');
...
// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
'application.extensions.*',
'pogostick.base.*',
'pogostick.behaviors.*',
'pogostick.components.*',
'pogostick.events.*',
'pogostick.helpers.*',
'pogostick.widgets.*',
'pogostick.widgets.jqui.*',
),
And in my Controller:
public function actionExamples()
{
$this->render( 'pogostick.widgets.examples.jqui_examples');
}
public function actionExamples2()
{
$this->render( 'pogostick.widgets.examples.jqTools_examples');
}
The first example works fine.
The second example returns this error:
PHP Error
Description
Undefined variable: oOwner
Source File:
C:\Servers\htdocs\aurora_yii\protected\extensions\pogostick\widgets\CPSjqToolsWrapper.php(55)
SECOND ERROR:
I want to used a jqGrid widget. I haven’t found a example and sure that i have all bad.
My files:
In my View:
<?php
CPSjqGridWidget::create(array(
'target'=>'#list',
//'url'=> CHtml::normalizeUrl(array('Example','data'=>'test')),
'url'=>CController::createUrl('infoGeografica/cargarmunicipios2'),
'datatype'=>'json',
'mtype'=>'GET',
'colNames'=>array('ID No','Nombre', 'Cod INE'),
'colModel'=>array(
array('name'=>'id', 'index'=>'id', 'width'=>55),
array('name'=>'nombre', 'index'=>'nombre', 'width'=>90),
array('name'=>'cod_ine', 'index'=>'cod_ine', 'width'=>80, 'align'=>'right'),
),
'pager'=>'#pager',
'rowNum'=>10,
'rowList'=>array(10,20,30),
'sortname'=>'id',
'sortorder'=>'desc',
'viewrecords'=>'true',
'caption'=>'My first grid',
'theme' => 'steel',
));
?>
And in my Controller:
public function actionCargarmunicipios2()
{
$page = $_GET['page']; // get the requested page
$limit = $_GET['rows']; // get how many rows we want to have into the grid
$sidx = $_GET['sidx']; // get index row - i.e. user click to sort
$sord = $_GET['sord']; // get the direction
if(!$sidx) $sidx =1;
//$responce->page = 1;
//$responce->total = 1;
//$responce->records = 6;
$responce->rows[0]['id']=0;
$responce->rows[0]['cell']=array(0,Prueba0,00001);
$responce->rows[1]['id']=0;
$responce->rows[1]['cell']=array(0,Prueba1,00002);
$responce->rows[2]['id']=0;
$responce->rows[2]['cell']=array(0,Prueba2,00003);
$responce->rows[3]['id']=0;
$responce->rows[3]['cell']=array(0,Prueba3,00004);
$responce->rows[4]['id']=0;
$responce->rows[4]['cell']=array(0,Prueba4,00005);
$responce->rows[5]['id']=0;
$responce->rows[5]['cell']=array(0,Prueba5,00006);
echo json_encode($responce);
}
Render the view the page return this error:
PHP Error
Description
Declaration of CPSjqGridWidget::create() should be compatible with that of CPSjqUIWrapper::create()
Source File:
C:\Servers\htdocs\aurora_yii\protected\extensions\pogostick\widgets\jqui\CPSjqGridWidget.php(24)
Can someone help me to learn to use this widget?
Thanks and regards.