Agile Toolkit  4.2
Agile Toolkit is a powerful web development framework. Inspired by GUI Applications development
Grid_Advanced Class Reference
Inheritance diagram for Grid_Advanced:
Grid_Basic CompleteLister Lister View AbstractView AbstractObject Grid InfoWindow MVCGrid

Public Member Functions

 init ()
 importFields ($model, $fields=undefined)
 defaultTemplate ()
 getExpanderId ()
 getColumn ($column)
 hasColumn ($column)
 removeColumn ($name)
 addButton ($label, $name=null, $return_button=false)
 addQuickSearch ($fields, $class='QuickSearch')
 makeSortable ($db_sort=null)
 makeTitle ()
 render ()
 format_number ($field)
 format_text ($field)
 format_html ($field)
 init_money ($field)
 init_real ($field)
 init_fullwidth ($field)
 format_fullwidth ($field)
 format_money ($field)
 format_totals_number ($field)
 format_totals_money ($field)
 format_totals_real ($field)
 format_totals_text ($field)
 format_time ($field)
 format_date ($field)
 format_datetime ($field)
 format_timestamp ($field)
 format_nowrap ($field)
 format_wrap ($field)
 format_template ($field)
 format_widget ($field, $widget, $params=array(), $widget_json=null)
 format_expander_widget ($field, $column)
 format_expander ($field, $column)
 init_expander_widget ($field)
 init_expander ($field)
 _getFieldType ($field)
 _inlineUpdate ($field, $id, $value)
 format_inline ($field, $idfield='id')
 format_nl2br ($field)
 format_order ($field, $idfield='id')
 init_link ($field)
 format_link ($field)
 _performDelete ($id)
 format_delete ($field)
 init_button ($field)
 setButtonClass ($class)
 init_delete ($field)
 _move_delete ($grid, $field)
 init_confirm ($field)
 init_prompt ($field)
 format_button ($field)
 format_confirm ($field)
 format_prompt ($field)
 init_boolean ($field)
 format_boolean ($field)
 format_checkbox ($field)
 format_image ($field)
 addRecordOrder ($field, $table='')
 staticSortCompare ($row1, $row2)
 applySorting ($i, $order, $desc)
 getIterator ()
 setTemplate ($template)
 getFieldStyle ($field, $id)
 getRowTitle ()
 getFieldContent ($field, $id)
 applyTDParams ($field, $totals=false)
 setTotalsTitle ($field, $title="Total:")
 formatTotalsRow ()
 updateTotals ()
 addPaginator ($ipp=25)
 setWidth ($width)
 setNoRecords ($message)
 getCurrentIndex ($idfield='id')
 setTDParam ($field, $path, $value)
 setTabMovesDown ($down=true)
 setShowSubmit ($show=true)
 setInlineProperties ($props)
 addOrder ()
 addSelectable ($field)
 addFormatter ($field, $formatter)
 setFormatter ($field, $formatter)
 getAllTDParams ()

Data Fields

 $sortby = '0'
 $sortby_db = null
 $not_found = false
 $displayed_rows = 0
 $totals_t = null
 $totals_value_na = '-'
 $data = null
 $title_col = array()
 $js_widget = 'ui.atk4_grid'
 $js_widget_arguments = array()
 $default_controller = 'MVCGrid'

Protected Attributes

 $no_records_message = "No matching records to display"
 $tab_moves_down = false
 $show_submit = true
 $tdparam = array()

Detailed Description

This is a Basic Grid implementation, which produces fully functional HTML grid capable of filtering, sorting, paginating and using multiple column formatters.

Use: $grid=$this->add('Grid'); $grid->setModel('User'); See

Member Function Documentation

_getFieldType ( field)
_inlineUpdate ( field,
_move_delete ( grid,
_performDelete ( id)
addButton ( label,
name = null,
return_button = false 
addFormatter ( field,
addOrder ( )
addPaginator ( ipp = 25)

Adds paginator to the grid

$ipprow count per page
$nameif set, paginator will get the name specified. Useful for saving different page numbers for different filtering conditions
addQuickSearch ( fields,
class = 'QuickSearch' 
addRecordOrder ( field,
table = '' 
addSelectable ( field)

Adds column on the basis of Model definition If $type is passed - column type is replaced by this value

applySorting ( i,
applyTDParams ( field,
totals = false 

Redefine to return default template, when 4th argument of add() is omitted

Reimplemented from Grid_Basic.

Reimplemented in InfoWindow.

format_boolean ( field)
format_button ( field)
format_checkbox ( field)
format_confirm ( field)
format_date ( field)
format_datetime ( field)
format_delete ( field)
format_expander ( field,
format_expander_widget ( field,
format_fullwidth ( field)
format_html ( field)
format_image ( field)
format_inline ( field,
idfield = 'id' 

Formats the InlineEdit: field that on click should substitute the text in the columns of the row by the edit controls

The point is to set an Id for each column of the row. To do this, we should set a property showing that id should be added in prerender

format_link ( field)
format_money ( field)
format_nl2br ( field)
format_nowrap ( field)
format_number ( field)
format_order ( field,
idfield = 'id' 
format_prompt ( field)
format_template ( field)
format_text ( field)
format_time ( field)
format_timestamp ( field)
format_totals_money ( field)
format_totals_number ( field)
format_totals_real ( field)
format_totals_text ( field)
format_widget ( field,
params = array(),
widget_json = null 
format_wrap ( field)

Additional formatting for Totals row

Reimplemented from CompleteLister.

getColumn ( column)
getCurrentIndex ( idfield = 'id')

Returns the ID value of the expanded content on the basis of GET parameters

getFieldContent ( field,

Returns the properly formatted field content. Used firstly with Ajax::reloadExpandedField()

getFieldStyle ( field,

Returns the structured string with row styles. Used along with getRowContent() in row redrawing

Reimplemented from Lister.

hasColumn ( column)
importFields ( model,
fields = undefined 

Reimplemented from Grid_Basic.

init ( )

Initialize object. Always call parent

This method is called for initialization

Reimplemented from Grid_Basic.

Reimplemented in InfoWindow.

init_boolean ( field)
init_button ( field)
init_confirm ( field)
init_delete ( field)
init_expander ( field)
init_expander_widget ( field)
init_fullwidth ( field)
init_link ( field)
init_money ( field)
init_prompt ( field)
init_real ( field)
makeSortable ( db_sort = null)
makeTitle ( )
removeColumn ( name)
render ( )

Default render. Generates HTML presentation of the view based on $this->template and passes it to output() function which then inserts output into parent's template

For visual objects, their default action while rendering is rely on SMlite engine. For sake of simplicity and speed you can redefine this method with a simple call

Reimplemented from CompleteLister.

Reimplemented in InfoWindow.

setButtonClass ( class)
setFormatter ( field,
setInlineProperties ( props)

Sets inline properties.

$props- hash with properties: array('tab_moves_down'=>false/true,'show_submit'=>false/true,etc) hash keys should replicate local properties names
setNoRecords ( message)
setShowSubmit ( show = true)
setTabMovesDown ( down = true)
setTDParam ( field,
setTemplate ( template)
setTotalsTitle ( field,
title = "Total:" 
setWidth ( width)
staticSortCompare ( row1,

Update totals on rows. Called at the start of formatRow()

Reimplemented from CompleteLister.

Field Documentation

$data = null
$default_controller = 'MVCGrid'

When using setModel() with Views some views will want to populate fields, columns etc corresponding to models meta-data. That is the job of Controller. When you create a custom controller for your view set this property to point at your controller and it will be used automatically

Reimplemented from Grid_Basic.

$displayed_rows = 0
$js_widget = 'ui.atk4_grid'
$js_widget_arguments = array()
$no_records_message = "No matching records to display" [protected]
$not_found = false
$show_submit = true [protected]

Inline related property Wether or not to show submit line

$sortby = '0'
$sortby_db = null
$tab_moves_down = false [protected]

Inline related property If true - TAB key submits row and activates next row

$tdparam = array() [protected]

$tdparam property is an array with cell parameters specified in td tag. This should be a hash: 'param_name'=>'param_value' Following parameters treated and processed in a special way: 1) 'style': nested array, style parameter. items of this nested array converted to a form of style: style="param_name: param_value; param_name: param_value" 2) OBSOLTE! wrap: possible values are true|false; if true, 'wrap' is added use style/white-space property or simply format_wrap()

All the rest are not checked and converted to a form of param_name="param_value"

This is a tree-like array with the following structure: array( [level1]=>dataset_row=array( [level2]=>field=array( [level3]=>tdparam_elements=array( param_name=>param_value ) ) ) )

$title_col = array()
$totals_t = null

Will be initialized to "totals" template when addTotals() is called

Reimplemented from CompleteLister.

$totals_value_na = '-'

The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables Enumerations