PhpExt : Grid [ class tree ] [ index ] [ all elements ]

Class: PhpExt_Grid_ColumnModel

Source Location: /PhpExt/Grid/ColumnModel.php

Class PhpExt_Grid_ColumnModel

Class Overview

This is the default implementation of a ColumnModel used by the Grid. This class is initialized with an Array of column config objects.

An individual column's config object defines the header string, the Ext.data.Record field the column draws its data from, an otional rendering function to provide customized data formatting, and the ability to apply a CSS class to all cells in a column through its id config option.

Usage:

  1.  $colModel new PhpExt_Grid_ColumnModel();
  2.  $colModel->addColumn(PhpExt_Grid_ColumnConfigObject::getInstance('Ticker')
  3.                                ->setWidth(60)
  4.                              ->setSortable(true))
  5.              ->addColumn(PhpExt_Grid_ColumnConfigObject::getInstance('Company Name')
  6.                                ->setWidth(150)
  7.                              ->setSortable(true))
  8.             ->addColumn(PhpExt_Grid_ColumnConfigObject::getInstance('Market Cap.')
  9.                                ->setWidth(100)
  10.                              ->setSortable(true))
  11.              );
  12.  
  13.   // Or like this...
  14.  
  15.   $salesCol new PhpExt_Grid_ColumnConfigObject('$ Sales');
  16.   $salesCol->setWidth(100)
  17.               ->setSortable(true)
  18.               ->setRenderer(PhpExt_JavascriptStm::variable('money'));
  19.   $empCol new PhpExt_Grid_ColumnConfigObject('Employees');
  20.   $empCol->setWidth(100)
  21.             ->setSortable(true)
  22.             ->setResizable(false);
  23.  
  24.   $colModel->addColumn($salesCol)
  25.               ->addColumn($empCol);

Located in /PhpExt/Grid/ColumnModel.php [line 59]

PhpExt_Object
   |
   --PhpExt_Observable
      |
      --PhpExt_Grid_ColumnModel

Properties

Methods

[ Top ]
Method Summary
PhpExt_Grid_ColumnModel   __construct()  
PhpExt_Grid_ColumnModel   addColumn()  
PhpExt_Grid_IColumnCollection   getColumns()  
void   getConfigParams()  
void   getJavascript()  

[ Top ]
Properties
PhpExt_Grid_IColumnCollection   $_columns = null [line 65]
API Tags:
Access:  public


[ Top ]
Methods
Constructor __construct  [line 82]

  PhpExt_Grid_ColumnModel __construct( )


API Tags:
Access:  public


Redefinition of:
PhpExt_Observable::__construct()

[ Top ]
addColumn  [line 70]

  PhpExt_Grid_ColumnModel addColumn( PhpExt_Grid_IColumn $column  )

Parameters:
PhpExt_Grid_ColumnConfigObject   $column: 

API Tags:
Access:  public


[ Top ]
getColumns  [line 78]


API Tags:
Access:  public


[ Top ]
getConfigParams  [line 115]

  void getConfigParams( [ $lazy = false]  )

Parameters:
   $lazy: 

API Tags:
Access:  protected


Redefinition of:
PhpExt_Observable::getConfigParams()

[ Top ]
getJavascript  [line 92]

  void getJavascript( [ $lazy = false], [ $varName = null]  )

Parameters:
   $lazy: 
   $varName: 

API Tags:
Access:  public


Redefinition of:
PhpExt_Object::getJavascript()

[ Top ]

Documentation generated on Fri, 08 Aug 2008 15:51:31 -0500 by phpDocumentor 1.4.0