cvs: peardoc /en/package/structures/structures-datagrid example-extending.xml

From: Date: Thu, 24 Mar 2005 15:29:52 +0000
Subject: cvs: peardoc /en/package/structures/structures-datagrid example-extending.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-5723@lists.php.net to get a copy of this message
asnagy Thu Mar 24 10:29:52 2005 EDT Modified files: /peardoc/en/package/structures/structures-datagrid example-extending.xml Log: Cleaned up doc http://cvs.php.net/diff.php/peardoc/en/package/structures/structures-datagrid/example-extending.xml?r1=1.1&r2=1.2&ty=u Index: peardoc/en/package/structures/structures-datagrid/example-extending.xml diff -u peardoc/en/package/structures/structures-datagrid/example-extending.xml:1.1 peardoc/en/package/structures/structures-datagrid/example-extending.xml:1.2 --- peardoc/en/package/structures/structures-datagrid/example-extending.xml:1.1 Thu Mar 17 14:42:31 2005 +++ peardoc/en/package/structures/structures-datagrid/example-extending.xml Thu Mar 24 10:29:52 2005 @@ -1,35 +1,37 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.structures.structures-datagrid.example-extending"> <refnamediv> <refname>Example - Extending the DataGrid</refname> - <refpurpose>Commonly you will want to use the DataGrid throught your application with the same look and feel and features. You may also want to -extend upon the existing features of the DataGrid to allow for customized functionality. Below you will see how to extend the DataGrid to allow -for this customizability. + <refpurpose> + Commonly you will want to use the DataGrid throught your application with + the same look-and-feel and features. You may also want to extend upon the + existing features of the DataGrid to allow for customized functionality. + Below you will see how to extend the DataGrid to allow for this + customizability. </refpurpose> </refnamediv> - <refsect1 id="package.structures.structures-datagrid.example-advanced.desc"> - &title.desc; + <refsect1 id="package.structures.structures-datagrid.example-extending.example"> + &title.example + <title>Extending the class</title> + <para> + This example will show you how to extend the DataGrid so you can have the + same look and feel throughout your application. + </para> - <refsect2 id="package.structures.structures-datagrid.example-advanced.desc.bind"> + <example> <title>Extending the class</title> - <para> - This example will show you how to extend the DataGrid so you can have the same look and feel throughout your application. - </para> - - <example> - <title>Extending the class</title> - <programlisting role="php"> - <![CDATA[ + <programlisting role="php"> + <![CDATA[ <?php require('Structures/DataGrid.php'); -class DataGrid extends Structures_DataGrid { - function DataGrid($limit = null, $page = 1, $renderer = DATAGRID_RENDERER_TABLE) +class myDataGrid extends Structures_DataGrid { + function myDataGrid($limit = null, $page = null) { - Structures_DataGrid::Structures_DataGrid($limit, $page, $renderer); + parent::Structures_DataGrid($limit, $page, $renderer); // Define DataGrid Color Attributes $this->renderer->setTableEvenRowAttributes(array('class' => 'evenrow')); @@ -40,22 +42,16 @@ $this->renderer->setTableAttribute('cellspacing', '1'); $this->renderer->setTableAttribute('cellpadding', '4'); $this->renderer->setTableAttribute('class', 'datagrid'); + + // Set sorting icons $dg->renderer->sortIconASC = '&uarr;'; $dg->renderer->sortIconDESC = '&darr;'; } } - -function printCheckbox($params) -{ - extract($params); - return '<input type="checkbox" name="idList[]" value="' . $record['id'] . '">'; -} ?> - ]]> - </programlisting> - </example> - </refsect2> - + ]]> + </programlisting> + </example> </refsect1> </refentry>

« previous php.pear.doc (#5723) next »