Helper class for jqgrid widgets

package org.openpsa.widgets

 Methods

__construct (string $identifier, string $datatype)

Constructor.

Add head elements when necessary and the ID column

Parameters

$identifier

stringThe grid's ID

$datatype

stringThe grid's data type

__toString ()

add_head_elements ()

function that loads the necessary javascript & css files for jqgrid
Static

add_pager ($rows_per_page)

Parameters

$rows_per_page

get_identifier ()

Returns the grid's ID

Returns

string

get_option ($key)

Parameters

$key

get_provider ()

prepend_js (string $string)

Add Javascript code that should be run before the widget constructor

Parameters

$string

string

remove_column (string $name)

Removes a column

Parameters

$name

stringThe column's name

render ($entries)

Renders the grid as HTML

Parameters

$entries

set_column (string $name, string $label, string $options, string $separate_index)

Set a column

Parameters

$name

stringThe column's name

$label

stringThe column's label

$options

stringThe column's options

$separate_index

stringShould the column have a separate index, if so, which sort type

set_option (string $key, mixed $value, boolean $autoquote_string)

Set an option

Parameters

$key

stringThe option's name

$value

mixedThe option's value

$autoquote_string

booleanShould string values be quoted

set_provider (\org_openpsa_widgets_grid_provider $provider)

Parameters

$provider

_render_colmodel ()

 Properties

 

array $_columns

The grid's columns

They have the following structure

'key' => array ( 'label' => "Some label", 'options' => 'javascript option string' )

   

boolean $_head_elements_added

Flag that tracks if JS/CSS files have already been added
 

string $_identifier

The grid's ID
 

array $_options

The grid's options (converted for use in JS constructor)
 

string $_prepend_js

Javascript code that should be prepended to the widget constructor
 

\org_openpsa_widgets_grid_provider $_provider

The data provider, if any
 

array $_raw_options

The grid's options as passed in PHP