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

From: Date: Thu, 17 Mar 2005 19:42:33 +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-5688@lists.php.net to get a copy of this message
asnagy Thu Mar 17 14:42:33 2005 EDT Added files: /peardoc/en/package/structures/structures-datagrid example-extending.xml Log: Initial Checkin. File is in beginning stages, more to come. http://cvs.php.net/co.php/peardoc/en/package/structures/structures-datagrid/example-extending.xml?r=1.1&p=1 Index: peardoc/en/package/structures/structures-datagrid/example-extending.xml +++ peardoc/en/package/structures/structures-datagrid/example-extending.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <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> </refnamediv> <refsect1 id="package.structures.structures-datagrid.example-advanced.desc"> &title.desc; <refsect2 id="package.structures.structures-datagrid.example-advanced.desc.bind"> <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[ <?php require('Structures/DataGrid.php'); class DataGrid extends Structures_DataGrid { function DataGrid($limit = null, $page = 1, $renderer = DATAGRID_RENDERER_TABLE) { Structures_DataGrid::Structures_DataGrid($limit, $page, $renderer); // Define DataGrid Color Attributes $this->renderer->setTableEvenRowAttributes(array('class' => 'evenrow')); $this->renderer->setTableOddRowAttributes(array('class' => 'oddrow')); // Define DataGrid Table Attributes $this->renderer->setTableAttribute('width', '100%'); $this->renderer->setTableAttribute('cellspacing', '1'); $this->renderer->setTableAttribute('cellpadding', '4'); $this->renderer->setTableAttribute('class', 'datagrid'); $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> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->

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