This extension is a (now) basic wrapper for jqGrid. This is an early release, using jqGrid 3.5 beta. Please help testing it in as many browsers as possible, and post your comments on the board.
Checksums ¶
- cadb320e33d838fa068b978613b1b515 jqgrid-0.1.tar.bz2
- 5cd470b7f59cc34cc1ddb999100f1832 jqgrid-0.1.zip
Resources ¶
Documentation ¶
Requirements ¶
- Yii 1.0 or above
- jui extension
Installation ¶
- Install the jui extension
- Extract the release file under
protected/extensions
Usage ¶
See the following code example:
<?
$this->widget('application.extensions.jqgrid.EJqGrid',
array(
'name'=>'jqgrid1',
'compression'=>'none',
'theme'=>'redmond',
'useNavBar'=>true,
'useNavBar'=>'false',
'options'=>array(
'datatype'=>'xml',
'url'=>'http://localhost/~metayii/yii-svn/demos/helloworld2/?r=site/list',
'colNames'=>array('Index','Aircraft','BuiltBy'),
'colModel'=>array(
array('name'=>'id','index'=>'id','width'=>'55','name'=>'invdate','index'=>'invdate','width'=>90),
array('name'=>'aircraft','index'=>'aircraft','width'=>90),
array('name'=>'factory','index'=>'factory','width'=>100)
),
'rowNum'=>10,
'rowList'=>array(10,20,30),
'sortname'=>'id',
'viewrecords'=>true,
'sortorder'=>"desc",
'caption'=>"Airplanes from XML"
)
)
);
?>
where http://localhost/~metayii/yii-svn/demos/helloworld2/?r=site/list is an action which returns XML code, for instance:
class ListAction extends CAction
{
public function run()
{
$xml =<<<EOP
<?xml version='1.0' encoding='utf-8'?>
<rows>
<page>1</page>
<total>1</total>
<records>4</records>
<row id="1">
<cell>1</cell>
<cell>F-14</cell>
<cell>Grumman</cell>
</row>
<row id="2">
<cell>2</cell>
<cell>F-15</cell>
<cell>Boeing</cell>
</row>
</rows>
EOP;
header("Content-Type: application/xml");
header("Content-Length: " . strlen($xml));
echo $xml;
}
}
(you can construct the XML from a database recordset, for example)
Change Log ¶
20090613 (0.1 beta) ¶
- Initial release.
i enhanced this extension~
as the title, how can i sumit the fix version to you?
on jqGrid official document is explain the api:
http://www.secondpersonplural.ca/jqgriddocs/_2er0j2mvk.htm
so, i upload on my host, and you can refere the modification
http://php.21deke.com/.tmp/EJqGrid.txt
one more question~
behind the "navBarOptions", has more settings~
like:
).navGrid( '#grid-pager', // options { search: false, addfunc: function() { window.location.href = url('/add'); }, editfunc: function(id) { window.location.href = url('/edit', {id: id}); } }, // edit { }, // add { }, // del { url: createUrl('del') } );
current edition can not set this?
i found the solution in source code~
'addfunc' => 'js:function() { alert(1); }',
above code can work~
:)
how to set addfunc?
on navBarOptions settings,
how to set addfunc, editfunc, etc...
[code]
'navBarOptions' => array(
'search' => false, 'addfunc' => "function() { window.location.href = url('/add'); }",
),
[/code]
the above code can't work
jui extensions
i found zii.widget.jui in svn!
this extension can use the zii.widget.jui to compile?
if use the zii, i can save more than disc space:)
Theme
How can I set up a theme for jqGrid?
In official jqGrid documentation I found this:
In order to use jqGrid 3.5, first a UI theme css file should be loaded.
where the path_to_ui_css_file is a valid path to the ui theme file How can it maybe applyable to jqgrid extension?Download the desired theme (or build a custom one) from jQueryUI site
(www.jqueryui.com) and point in your link tag in head section the path to the
theme css
Constant defined twice / undefined constant _CHECK_JSPARAMETERS
line 340 in EJqGrid.php generates an error in my installation ....
Original line is ...
if (__CHECK_JS_PARAMETERS__) self::checkOptions($value, $this->validOptions);
Note the double underscore at start and end
Possible correction on line 62 is ....
define('__CHECK_JS_PARAMETERS__', true);
Again, note double underscore
bug in EJqGrid
There is a bug in EJqGrid.... you have to set path of js in line number 537 in EJqGrid. which have install from yii extension......
.................
foreach ($plugins as $file) {
$this->_clientScript->registerScriptFile($this->_baseUrl.'/[color="#FF0000"][b]plugins[/b][/color]/'.$file); }
..............................................................................
foreach ($plugins as $file) { $this->_clientScript->registerScriptFile($this->_baseUrl.'/[color="#00FF00"]js[/color]/'.$file); }
bug in EJqGrid
There is a bug in EJqGrid....
you have to set path of js in line number 537 in EJqGrid. which have install from yii extension.
foreach ($plugins as $file) { $this->_clientScript->registerScriptFile($this->_baseUrl.'/[color="#FF0000"][b]plugins[/b][/color]/'.$file); }
.............................................................................. foreach
($plugins as $file) { $this->_clientScript->registerScriptFile($this->_baseUrl.'/[color="#00FF00"]js[/color]/'.$file); }
bug in EJqGrid
There is a bug in EJqGrid.... you have to set path of js in line number 537 in EJqGrid. which have install from yii extension.
foreach ($plugins as $file)
{
$this->_clientScript->registerScriptFile($this->_baseUrl.'/plugins/'.$file);
}
.................................................
foreach($plugins as $file)
{
$this->_clientScript->registerScriptFile($this->_baseUrl.'/js/'.$file);
}
jqgrid
hope new update, thks
upd pls
doenst work with Yii 1.1.10 :(
Updated
Updated this to the most recent version of Yii - 1.1.12.
I will be updating this plugin here:
https://github.com/TigerWolf/yii-jqgrid
question
Does it work only with xml elements ??
Can the extension access to database directly through ActionAdmin for example (or other) which is defined by gii by default instead of create an xml list ?
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.