jqgrid jqGrid based grid

  1. Documentation
  2. Change Log

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.
9 0
22 followers
4 998 downloads
Yii Version: 1.1
License: GPL-3.0
Category: User Interface
Tags:
Developed by: MetaYii
Created on: Jun 13, 2009
Last updated: 14 years ago

Downloads

show all