Properties

$_identifier

$_identifier : string

The grid's ID

Type

string

$_options

$_options : array

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

Type

array

$_raw_options

$_raw_options : array

The grid's options as passed in PHP

Type

array

$_columns

$_columns : array

The grid's columns

They have the following structure

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

Type

array

$_head_elements_added

$_head_elements_added : boolean

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

Type

boolean

$_footer_data

$_footer_data : array

Data for the table footer

Type

array

$format_footer

$format_footer : boolean

Should formatters be applied to footer row

Type

boolean

$_prepend_js

$_prepend_js : string

Javascript code that should be prepended to the widget constructor

Type

string

Methods

add_head_elements()

add_head_elements() 

Adds the necessary javascript & css files for jqgrid

__construct()

__construct(string  $identifier, string  $datatype) 

Constructor. Add head elements when necessary and the ID column

Parameters

string $identifier

The grid's ID

string $datatype

The grid's data type

set_provider()

set_provider(\midcom\grid\provider  $provider) 

Parameters

\midcom\grid\provider $provider

get_provider()

get_provider() 

get_identifier()

get_identifier() : string

Returns the grid's ID

Returns

string

set_option()

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

Set an option

Parameters

string $key

The option's name

mixed $value

The option's value

boolean $autoquote_string

Should string values be quoted

get_option()

get_option(  $key) 

Parameters

$key

set_select_column()

set_select_column(string  $name, string  $label, string  $options, array  $selectdata) 

Set a column

Parameters

string $name

The column's name

string $label

The column's label

string $options

The column's options

array $selectdata

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

set_column()

set_column(string  $name, string  $label, string  $options = '', string  $separate_index = false) 

Set a column

Parameters

string $name

The column's name

string $label

The column's label

string $options

The column's options

string $separate_index

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

add_pager()

add_pager(  $rows_per_page = 30) 

Parameters

$rows_per_page

remove_column()

remove_column(string  $name) 

Removes a column

Parameters

string $name

The column's name

set_footer_data()

set_footer_data(mixed  $data, mixed  $value = null, boolean  $formatted = true) 

Set the grid's footer data

Parameters

mixed $data

The data to set as array or the column name

mixed $value

The value, if setting individual columns

boolean $formatted

Should formatters be applied to footer data

prepend_js()

prepend_js(string  $string) 

Add Javascript code that should be run before the widget constructor

Parameters

string $string

render()

render(  $entries = false) 

Renders the grid as HTML

Parameters

$entries

__toString()

__toString() 

_render_colmodel()

_render_colmodel()