Structures_DataGrid
[ class tree: Structures_DataGrid ] [ index: Structures_DataGrid ] [ all elements ]

Source for file removeColumn.php

Documentation is available at removeColumn.php

  1. <?php
  2. $datagrid =new Structures_DataGrid();
  3.  
  4. // Replace this with your database access informations:
  5. $bindOptions['dsn'"mysql://foo:bar@host/world";
  6.  
  7. // The City table contains 5 fields: ID, Name, CountryCode, District and Population
  8. $datagrid->bind("SELECT * FROM City ORDER BY Population"$bindOptions);
  9.  
  10. // We want to remove the ID field, so we retrieve a reference to the Column:
  11. $column =$datagrid->getColumnByField('ID');
  12.  
  13. // And we drop that column:
  14. $datagrid->removeColumn($column);
  15.  
  16. // This will only render 4 fields: Name, CountryCode, District and Population:
  17. $datagrid->render();
  18. ?>

Documentation generated on Mon, 11 Mar 2019 15:47:20 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.