silverorange Code


Swat.SwatTableView
/Swat/SwatTableView.php at line 31

Class SwatTableView

SwatObject
└─SwatUIObject
└─SwatWidget
└─SwatControl
└─SwatView
└─SwatTableView

public class SwatTableView
extends SwatView

A widget to display data in a tabular form

Records in this table-view's model may be selected by the user by adding a view-selector to this table-view. See SwatView for details on how to use SwatViewSelector objects.

Copyright:
2004-2007 silverorange
License:
http://www.gnu.org/copyleft/lesser.html LGPL License 2.1

Field Summary
protected array

$columns

The columns of this table-view.

protected array

$columns_by_id

The columns of this table-view indexed by their unique identifier.

SwatTableViewOrderableColumn

$default_orderby_column

The column of this table-view that the data in the model is sorted by by default if no sorting is happening.

protected array

$extra_rows

Any extra rows that were appended to this view.

protected array

$groups

Grouping objects for this table view.

protected array

$groups_by_id

The groups of this table-view indexed by their unique identifier.

protected boolean

$has_input_row

Whether or not this table view has an input row.

string

$no_records_message

No records message text.

string

$no_records_message_type

Optional content type for the no records message.

SwatTableViewOrderableColumn

$orderby_column

The column of this table-view that data in the model is currently being sorted by.

protected array

$rows_by_id

The extra rows of this table-view indexed by their unique identifier.

protected array

$spanning_columns

Row column objects for this table view.

protected array

$spanning_columns_by_id

The row columns of this table-view indexed by their unique identifier.

boolean

$use_invalid_tfoot_ordering

Whether of not to display the tfoot element after the tbody element.

Fields inherited from Swat.SwatView
checked_items, model, selections, selectors
Constructor Summary

SwatTableView(string id)

Creates a new table view.

Method Summary
void

addChild(mixed child)

Adds a child object.

void

appendColumn(SwatTableViewColumn column)

Appends a column to this table-view.

void

appendGroup(SwatTableViewGroup group)

Appends a grouping object to this table-view.

void

appendRow(SwatTableViewRow row)

Appends a single row to this table-view.

void

appendSpanningColumn(SwatTableViewSpanningColumn column)

Appends a spanning column object to this table-view.

SwatUIObject

copy(string id_suffix)

Performs a deep copy of the UI tree starting with this UI object.

void

display()

Displays this table-view.

protected void

displayBody()

Displays the contents of this view.

protected void

displayFooter()

Displays any footer content for this table-view.

protected void

displayHeader()

Displays the column headers for this table-view.

protected void

displayRow(mixed row, mixed next_row, integer count)

Displays a single row.

protected void

displayRowColumns(mixed row, mixed next_row, integer count)

Displays the columns for a row.

protected void

displayRowGroupFooters(mixed row, mixed next_row, integer count)

Displays row group headers.

protected void

displayRowGroupHeaders(mixed row, mixed next_row, integer count)

Displays row group headers.

protected void

displayRowMessages(mixed row)

Displays a list of SwatMessage object for the given row.

protected void

displayRowSpanningColumns(mixed row, mixed next_row, integer count)

Displays row spanning columns.

protected array

getCSSClassNames()

Gets the array of CSS classes that are applied to this table view.

SwatTableViewColumn

getColumn(string id)

Gets a column in this table-view by the column's id.

integer

getColumnCount()

Gets the number of columns in this table-view.

array

getColumns()

Gets all columns of this table-view as an array.

array

getDescendantStates()

Gets descendant states.

array

getDescendants(string class_name)

Gets descendant UI-objects.

SwatUIObject

getFirstDescendant(string class_name)

Gets the first descendant UI-object of a specific class.

SwatTableViewRow

getFirstRowByClass(string class_name)

Gets the first extra row of the specified class from this table-view.

SwatTableViewGroup

getGroup(string id)

Gets a group in this table-view by the group's id.

array

getGroups()

Gets all groups of this table-view as an array.

SwatHtmlHeadEntrySet

getHtmlHeadEntrySet()

Gets the SwatHtmlHeadEntry objects needed by this table.

protected string

getInlineJavaScript()

Gets inline JavaScript required by this table-view as well as any JavaScript required by columns and/or rows.

array

getMessages()

Gathers all messages from this table-view.

SwatTableViewRow

getRow(string id)

Gets a row in this table-view by the row's id.

protected string

getRowClassString(mixed row, integer count)

Gets CSS class string for the XHTML tr tag.

protected array

getRowClasses(mixed row, integer count)

Gets CSS classes for the XHTML tr tag.

array

getRowsByClass(string class_name)

Gets all the extra rows of the specified class from this table-view.

SwatTableViewSpanningColumn

getSpanningColumn(string id)

Gets a spanning column in this table-view by the spanning column's id.

array

getSpanningColumns()

Gets all spanning columns of this table-view as an array.

integer

getVisibleColumnCount()

Gets the number of visible columns in this table-view.

array

getVisibleColumns()

Gets all visible columns of this table-view as an array.

integer

getXhtmlColspan()

Gets how many XHTML table columns the visible column objects of this table-view object span on display.

boolean

hasColumn(string id)

Returns true if a column with the given id exists within this table-view.

boolean

hasGroup(string id)

Returns true if a group with the given id exists within this table-view.

protected void

hasHeader()

Whether this table has a header to display.

boolean

hasMessage()

Gets whether or not this table-view has any messages.

boolean

hasRow(string id)

Returns true if a row with the given id exists within this table-view.

SwatTableViewSpanningColumn

hasSpanningColumn(mixed id)

Returns true if a spanning column with the given id exists within this table-view.

void

init()

Initializes this table-view.

protected void

insertColumn(SwatTableViewColumn column, SwatTableViewColumn reference_column, boolean after)

Helper method to insert columns into this table-view.

void

insertColumnAfter(SwatTableViewColumn column, SwatTableViewColumn reference_column)

Inserts a column after an existing column in this table-view.

void

insertColumnBefore(SwatTableViewColumn column, SwatTableViewColumn reference_column)

Inserts a column before an existing column in this table-view.

protected void

insertRow(SwatTableViewRow row, SwatTableViewRow reference_row, boolean after)

Helper method to insert rows into this table-view.

void

insertRowAfter(SwatTableViewRow row, SwatTableViewRow reference_row)

Inserts a row after an existing row in this table-view.

void

insertRowBefore(SwatTableViewRow row, SwatTableViewRow reference_row)

Inserts a row before an existing row in this table-view.

void

process()

Processes this table-view.

protected boolean

rowHasMessage(mixed row)

Whether any of the columns in the row has a message.

void

setDefaultOrderbyColumn(mixed column, integer direction, SwatTableViewOrderableColumn the)

Sets a default column to use for ordering the data of this table-view.

void

setDescendantStates(array states)

Sets descendant states.

protected void

validateColumn(SwatTableViewColumn column)

Ensures a column added to this table-view is valid for this table-view.

protected void

validateGroup(SwatTableViewGroup group)

Ensures a group added to this table-view is valid for this table-view.

protected void

validateRow(SwatTableViewRow row)

Ensures a row added to this table-view is valid for this table-view.

Methods inherited from Swat.SwatView
addSelector, getSelection, init, setSelection
Methods inherited from Swat.SwatControl
addMessage, getNote, printWidgetTree
Methods inherited from Swat.SwatWidget
addCompositeWidget, addMessage, confirmCompositeWidgets, copy, createCompositeWidgets, display, displayHtmlHeadEntries, getCSSClassNames, getCompositeWidget, getCompositeWidgets, getFocusableHtmlId, getHtmlHeadEntrySet, getMessages, hasMessage, init, isDisplayed, isInitialized, isProcessed, isSensitive, printWidgetTree, process, replaceWithContainer
Methods inherited from Swat.SwatUIObject
addComment, addJavaScript, addStyleSheet, addTangoAttribution, copy, getCSSClassNames, getCSSClassString, getFirstAncestor, getHtmlHeadEntrySet, getInlineJavaScript, getUniqueId, isVisible

Field Detail

/Swat/SwatTableView.php at line 165

columns

protected array $columns = array()

The columns of this table-view


/Swat/SwatTableView.php at line 119

columns_by_id

protected array $columns_by_id = array()

The columns of this table-view indexed by their unique identifier

A unique identifier is not required so this array does not necessarily contain all columns in the view. It serves as an efficient data structure to lookup columns by their id.

The array is structured as id => column reference.


/Swat/SwatTableView.php at line 69

default_orderby_column

public SwatTableViewOrderableColumn $default_orderby_column = null

The column of this table-view that the data in the model is sorted by by default if no sorting is happening

Setting this directly usually won't do what you want. Use the SwatTableView::setDefaultOrderbyColumn() method instead.

If this is null then the default order of data in the model is some implicit order that the user cannot see. This results in tri-state column headers.

If this is set then the data ordering is always explicit and visible to the user. This results in bi-state column headers.

See Also:
SwatTableViewOrderableColumn
SwatTableView::setDefaultOrderbyColumn()

/Swat/SwatTableView.php at line 193

extra_rows

protected array $extra_rows = array()

Any extra rows that were appended to this view

This array does not include rows that are displayed based on this table-view's model.


/Swat/SwatTableView.php at line 183

groups

protected array $groups = array()

Grouping objects for this table view

See Also:
SwatTableView::addGroup()

/Swat/SwatTableView.php at line 145

groups_by_id

protected array $groups_by_id = array()

The groups of this table-view indexed by their unique identifier

A unique identifier is not required so this array does not necessarily contain all groups in the view. It serves as an efficient data structure to lookup groups by their id.

The array is structured as id => group reference.


/Swat/SwatTableView.php at line 204

has_input_row

protected boolean $has_input_row = false

Whether or not this table view has an input row

Only one input row is allowed for each table-view.

See Also:
SwatTableViewInputRow

/Swat/SwatTableView.php at line 79

no_records_message

public string $no_records_message = ''

No records message text

A message to show if the table view has no records to display. If null, no message is displayed.


/Swat/SwatTableView.php at line 88

no_records_message_type

public string $no_records_message_type = 'text/plain'

Optional content type for the no records message

Default text/plain, use text/xml for XHTML fragments.


/Swat/SwatTableView.php at line 48

orderby_column

public SwatTableViewOrderableColumn $orderby_column

The column of this table-view that data in the model is currently being sorted by

If no sorting is currently happening, this can be null. Alternatively, this can be set to a SwatTableViewOrderableColumn and the column itself may be set to no sorting.

Todo:
Clean up this API. Making this a public property is prone to misuse.

/Swat/SwatTableView.php at line 158

rows_by_id

protected array $rows_by_id = array()

The extra rows of this table-view indexed by their unique identifier

A unique identifier is not required so this array does not necessarily contain all extra rows in the view. It serves as an efficient data structure to lookup extra rows by their id.

The array is structured as id => row reference.


/Swat/SwatTableView.php at line 174

spanning_columns

protected array $spanning_columns = array()

Row column objects for this table view

See Also:
SwatTableView::addSpanningColumn()

/Swat/SwatTableView.php at line 132

spanning_columns_by_id

protected array $spanning_columns_by_id = array()

The row columns of this table-view indexed by their unique identifier

A unique identifier is not required so this array does not necessarily contain all row columns in the view. It serves as an efficient data structure to lookup row columns by their id.

The array is structured as id => column reference.


/Swat/SwatTableView.php at line 103

use_invalid_tfoot_ordering

public boolean $use_invalid_tfoot_ordering = false

Whether of not to display the tfoot element after the tbody element

If this flag is set to true, the tfoot element will be displayed after the tbody element. This is invalid XHTML but fixes a number of rendering bugs in various browsers. This flag defaults to false.

When browser support for tfoot is better, this property will be deprecated. This property is not recommended for use unless you are experiencing browser bugs in your table views.


Constructor Detail

/Swat/SwatTableView.php at line 218

SwatTableView

public SwatTableView(string id)

Creates a new table view

Parameters:
id - a non-visible unique id for this widget.
See Also:
SwatWidget::__construct()

Method Detail

/Swat/SwatTableView.php at line 387

addChild

public void addChild(mixed child)

Adds a child object

This method fulfills the SwatUIParent interface. It is used by SwatUI when building a widget tree and should not need to be called elsewhere.

To add columns, rows, or a grouping to a table-view, use SwatTableView::appendColumn(), SwatTableView::appendRow(), or SwatTableView::appendGroup().

Parameters:
child - a reference to a child object to add.
Throws:
SwatInvalidClassException
See Also:
SwatUIParent
SwatTableView::appendColumn()
SwatTableView::appendGroup()
SwatTableView::appendRow()

/Swat/SwatTableView.php at line 1214

appendColumn

public void appendColumn(SwatTableViewColumn column)

Appends a column to this table-view

Parameters:
column - the column to append.
Throws:
if the column has the same id as a column already in this table-view.

/Swat/SwatTableView.php at line 1576

appendGroup

public void appendGroup(SwatTableViewGroup group)

Appends a grouping object to this table-view

A grouping object affects how the data in the table model is displayed in this table-view. With a grouping, rows are split into groups with special group headers above each group.

Multiple groupings may be added to table-views.

Parameters:
group - the table-view grouping to append to this table-view.
See Also:
SwatTableViewGroup
Throws:
if the group has the same id as a group already in this table-view.

/Swat/SwatTableView.php at line 1681

appendRow

public void appendRow(SwatTableViewRow row)

Appends a single row to this table-view

Rows appended to table-views are displayed after all the data from the table-view model is displayed.

Parameters:
row - the row to append.
Throws:
if the row has the same id as a row already in this table-view.

/Swat/SwatTableView.php at line 1498

appendSpanningColumn

public void appendSpanningColumn(SwatTableViewSpanningColumn column)

Appends a spanning column object to this table-view

Parameters:
column - the table-view spanning column to use for this table-view.
See Also:
SwatTableViewSpanningColumn

/Swat/SwatTableView.php at line 727

copy

public SwatUIObject copy(string id_suffix)

Performs a deep copy of the UI tree starting with this UI object

Parameters:
id_suffix - optional. A suffix to append to copied UI objects in the UI tree.
Returns:
a deep copy of the UI tree starting with this UI object.
See Also:
SwatUIObject::copy()

/Swat/SwatTableView.php at line 283

display

public void display()

Displays this table-view

The table view is displayed as an XHTML table.


/Swat/SwatTableView.php at line 830

displayBody

protected void displayBody()

Displays the contents of this view

The contents reflect the data stored in the model of this table-view. Things like row highlighting are done here.

Table rows are displayed inside a XHTML tag.


/Swat/SwatTableView.php at line 1030

displayFooter

protected void displayFooter()

Displays any footer content for this table-view

Rows in the footer are outputted inside a HTML tag.


/Swat/SwatTableView.php at line 807

displayHeader

protected void displayHeader()

Displays the column headers for this table-view

Each column is asked to display its own header. Rows in the header are outputted inside a HTML tag.


/Swat/SwatTableView.php at line 872

displayRow

protected void displayRow(mixed row, mixed next_row, integer count)

Displays a single row

The contents reflect the data stored in the model of this table-view. Things like row highlighting are done here.

Parameters:
row - the row to display.
next_row - the next row that will be displayed. If there is no next row, this is null.
count - the ordinal position of the current row. Starts at one.

/Swat/SwatTableView.php at line 929

displayRowColumns

protected void displayRowColumns(mixed row, mixed next_row, integer count)

Displays the columns for a row

Parameters:
row - the row to display.
next_row - the next row that will be displayed. If there is no next row, this is null.
count - the ordinal position of the current row. Starts at one.

/Swat/SwatTableView.php at line 911

displayRowGroupFooters

protected void displayRowGroupFooters(mixed row, mixed next_row, integer count)

Displays row group headers

Parameters:
row - the row to display.
next_row - the next row that will be displayed. If there is no next row, this is null.
count - the ordinal position of the current row. Starts at one.

/Swat/SwatTableView.php at line 893

displayRowGroupHeaders

protected void displayRowGroupHeaders(mixed row, mixed next_row, integer count)

Displays row group headers

Parameters:
row - the row to display.
next_row - the next row that will be displayed. If there is no next row, this is null.
count - the ordinal position of the current row. Starts at one.

/Swat/SwatTableView.php at line 987

displayRowMessages

protected void displayRowMessages(mixed row)

Displays a list of SwatMessage object for the given row

Parameters:
row - the row for which to display messages.

/Swat/SwatTableView.php at line 960

displayRowSpanningColumns

protected void displayRowSpanningColumns(mixed row, mixed next_row, integer count)

Displays row spanning columns

Parameters:
row - the row to display.
next_row - the next row that will be displayed. If there is no next row, this is null.
count - the ordinal position of the current row. Starts at one.

/Swat/SwatTableView.php at line 1084

getCSSClassNames

protected array getCSSClassNames()

Gets the array of CSS classes that are applied to this table view

Returns:
the array of CSS classes that are applied to this table view.
See Also:
SwatUIObject::getCSSClassString()

/Swat/SwatTableView.php at line 1292

getColumn

public SwatTableViewColumn getColumn(string id)

Gets a column in this table-view by the column's id

Parameters:
id - the id of the column to get.
Returns:
the requested column.
Throws:
if no column with the specified id exists in this table-view.

/Swat/SwatTableView.php at line 1322

getColumnCount

public integer getColumnCount()

Gets the number of columns in this table-view

Returns:
the number of columns of this table-view.

/Swat/SwatTableView.php at line 1309

getColumns

public array getColumns()

Gets all columns of this table-view as an array

Returns:
the columns of this table-view.

/Swat/SwatTableView.php at line 684

getDescendantStates

public array getDescendantStates()

Gets descendant states

Retrieves an array of states of all stateful UI-objects in the widget subtree below this table-view.

Returns:
an array of UI-object states with UI-object identifiers as array keys.

/Swat/SwatTableView.php at line 532

getDescendants

public array getDescendants(string class_name)

Gets descendant UI-objects

Parameters:
class_name - optional class name. If set, only UI-objects that are instances of $class_name are returned.
Returns:
the descendant UI-objects of this table-view. If descendant objects have identifiers, the identifier is used as the array key.
See Also:
SwatUIParent::getDescendants()

/Swat/SwatTableView.php at line 604

getFirstDescendant

public SwatUIObject getFirstDescendant(string class_name)

Gets the first descendant UI-object of a specific class

Parameters:
class_name - class name to look for.
Returns:
the first descendant UI-object or null if no matching descendant is found.
See Also:
SwatUIParent::getFirstDescendant()

/Swat/SwatTableView.php at line 1809

getFirstRowByClass

public SwatTableViewRow getFirstRowByClass(string class_name)

Gets the first extra row of the specified class from this table-view

Unlike the SwatUIParent::getFirstDescendant() method, this method only checks this table-view and does not check the child objects of this table-view.

Parameters:
class_name - the class name to filter by.
Returns:
the first extra row of the specified class or null if no such row object exists in this table-view.
See Also:
SwatUIParent::getFirstDescendant()

/Swat/SwatTableView.php at line 1619

getGroup

public SwatTableViewGroup getGroup(string id)

Gets a group in this table-view by the group's id

Parameters:
id - the id of the group to get.
Returns:
the requested group.
Throws:
if no group with the specified id exists in this table-view.

/Swat/SwatTableView.php at line 1636

getGroups

public array getGroups()

Gets all groups of this table-view as an array

Returns:
the the groups of this table-view.

/Swat/SwatTableView.php at line 497

getHtmlHeadEntrySet

public SwatHtmlHeadEntrySet getHtmlHeadEntrySet()

Gets the SwatHtmlHeadEntry objects needed by this table

Returns:
the SwatHtmlHeadEntry objects needed by this table-view.
See Also:
SwatUIObject::getHtmlHeadEntrySet()

/Swat/SwatTableView.php at line 1148

getInlineJavaScript

protected string getInlineJavaScript()

Gets inline JavaScript required by this table-view as well as any JavaScript required by columns and/or rows.

Column JavaSscript is placed before extra row JavaScript.

Returns:
inline JavaScript needed by this table-view.

/Swat/SwatTableView.php at line 412

getMessages

public array getMessages()

Gathers all messages from this table-view

Returns:
an array of {@link SwatMessage} objects.

/Swat/SwatTableView.php at line 1762

getRow

public SwatTableViewRow getRow(string id)

Gets a row in this table-view by the row's id

Parameters:
id - the id of the row to get.
Returns:
the requested row.
Throws:
if no row with the specified id exists in this table-view.

/Swat/SwatTableView.php at line 1125

getRowClassString

protected string getRowClassString(mixed row, integer count)

Gets CSS class string for the XHTML tr tag

Parameters:
row - a data object containing the data to be displayed in this row.
count - the ordinal position of this row in the table.
Returns:
CSS class string.

/Swat/SwatTableView.php at line 1103

getRowClasses

protected array getRowClasses(mixed row, integer count)

Gets CSS classes for the XHTML tr tag

Parameters:
row - a data object containing the data to be displayed in this row.
count - the ordinal position of this row in the table.
Returns:
CSS class names.

/Swat/SwatTableView.php at line 1781

getRowsByClass

public array getRowsByClass(string class_name)

Gets all the extra rows of the specified class from this table-view

Parameters:
class_name - the class name to filter by.
Returns:
all the extra rows of the specified class.

/Swat/SwatTableView.php at line 1532

getSpanningColumn

public SwatTableViewSpanningColumn getSpanningColumn(string id)

Gets a spanning column in this table-view by the spanning column's id

Parameters:
id - the id of the row to get.
Returns:
the requested spanning column.
Throws:
if no spanning column with the specified id exists in this table-view.

/Swat/SwatTableView.php at line 1549

getSpanningColumns

public array getSpanningColumns()

Gets all spanning columns of this table-view as an array

Returns:
the spanning columns of this table-view.

/Swat/SwatTableView.php at line 1353

getVisibleColumnCount

public integer getVisibleColumnCount()

Gets the number of visible columns in this table-view

Returns:
the number of visible columns of this table-view.

/Swat/SwatTableView.php at line 1335

getVisibleColumns

public array getVisibleColumns()

Gets all visible columns of this table-view as an array

Returns:
the visible columns of this table-view.

/Swat/SwatTableView.php at line 477

getXhtmlColspan

public integer getXhtmlColspan()

Gets how many XHTML table columns the visible column objects of this table-view object span on display

Returns:
the number of XHTML table columns the visible column objects of this table-view object span on display.

/Swat/SwatTableView.php at line 1274

hasColumn

public boolean hasColumn(string id)

Returns true if a column with the given id exists within this table-view

Parameters:
id - the unique identifier of the column within this table view to check the existance of.
Returns:
true if the column exists in this table view and false if it does not.

/Swat/SwatTableView.php at line 1601

hasGroup

public boolean hasGroup(string id)

Returns true if a group with the given id exists within this table-view

Parameters:
id - the unique identifier of the group within this table- view to check the existance of.
Returns:
true if the group exists in this table-view and false if it does not.

/Swat/SwatTableView.php at line 784

hasHeader

protected void hasHeader()

Whether this table has a header to display

Each column is asked whether is has a header to display.


/Swat/SwatTableView.php at line 439

hasMessage

public boolean hasMessage()

Gets whether or not this table-view has any messages

Returns:
true if this table-view has one or more messages and false if it does not.

/Swat/SwatTableView.php at line 1744

hasRow

public boolean hasRow(string id)

Returns true if a row with the given id exists within this table-view

Parameters:
id - the unique identifier of the row within this table-view to check the existance of.
Returns:
true if the row exists in this table-view and false if it does not.

/Swat/SwatTableView.php at line 1513

hasSpanningColumn

public SwatTableViewSpanningColumn hasSpanningColumn(mixed id)

Returns true if a spanning column with the given id exists within this table-view

Returns:
the requested spanning column.

/Swat/SwatTableView.php at line 242

init

public void init()

Initializes this table-view

This initializes all columns, extra rows and groupsin this table-view.

See Also:
SwatWidget::init()

/Swat/SwatTableView.php at line 1446

insertColumn

protected void insertColumn(SwatTableViewColumn column, SwatTableViewColumn reference_column, boolean after)

Helper method to insert columns into this table-view

Parameters:
column - the column to insert.
reference_column - optional. An existing column within this table-view to which the inserted column is relatively positioned. If not specified, the column is inserted at the beginning or the end of this table-view's list of columns.
after - optional. If true and a reference column is specified, the column is inserted immediately before the reference column. If true and no reference column is specified, the column is inserted at the beginning of the column list. If false and a reference column is specified, the column is inserted immediately after the reference column. If false and no reference column is specified, the column is inserted at the end of the column list. Defaults to false.
Throws:
if the reference column does not exist in this table-view.
if the column to be inserted has the same id as a column already in this table-view.
See Also:
SwatTableView::appendColumn()
SwatTableView::insertColumnBefore()
SwatTableView::insertColumnAfter()

/Swat/SwatTableView.php at line 1255

insertColumnAfter

public void insertColumnAfter(SwatTableViewColumn column, SwatTableViewColumn reference_column)

Inserts a column after an existing column in this table-view

Parameters:
column - the column to insert.
reference_column - the column after which the column will be inserted.
Throws:
if the reference column does not exist in this table-view.
if the column has the same id as a column already in this table-view.

/Swat/SwatTableView.php at line 1234

insertColumnBefore

public void insertColumnBefore(SwatTableViewColumn column, SwatTableViewColumn reference_column)

Inserts a column before an existing column in this table-view

Parameters:
column - the column to insert.
reference_column - the column before which the column will be inserted.
Throws:
if the reference column does not exist in this table-view.
if the column has the same id as a column already in this table-view.

/Swat/SwatTableView.php at line 1888

insertRow

protected void insertRow(SwatTableViewRow row, SwatTableViewRow reference_row, boolean after)

Helper method to insert rows into this table-view

Parameters:
row - the row to insert.
reference_row - optional. An existing row within this table-view to which the inserted row is relatively positioned. If not specified, the row is inserted at the beginning or the end of this table-view's list of extra rows.
after - optional. If true and a reference row is specified, the row is inserted immediately before the reference row. If true and no reference row is specified, the row is inserted at the beginning of the extra row list. If false and a reference row is specified, the row is inserted immediately after the reference row. If false and no reference row is specified, the row is inserted at the end of the extra row list. Defaults to false.
Throws:
if the reference row does not exist in this table-view.
if the row to be inserted has the same id as a row already in this table-view.
See Also:
SwatTableView::appendRow()
SwatTableView::insertRowBefore()
SwatTableView::insertRowAfter()

/Swat/SwatTableView.php at line 1726

insertRowAfter

public void insertRowAfter(SwatTableViewRow row, SwatTableViewRow reference_row)

Inserts a row after an existing row in this table-view

Parameters:
row - the row to insert.
reference_row - the row after which the row will be inserted.
Throws:
if the reference row does not exist in this table-view.
if the row has the same id as a row already in this table-view.
if the row is an input row and this table-view already contains an input-row.

/Swat/SwatTableView.php at line 1703

insertRowBefore

public void insertRowBefore(SwatTableViewRow row, SwatTableViewRow reference_row)

Inserts a row before an existing row in this table-view

Parameters:
row - the row to insert.
reference_row - the row before which the row will be inserted.
Throws:
if the reference row does not exist in this table-view.
if the row has the same id as a row already in this table-view.
if the row is an input row and this table-view already contains an input-row.

/Swat/SwatTableView.php at line 343

process

public void process()

Processes this table-view


/Swat/SwatTableView.php at line 1061

rowHasMessage

protected boolean rowHasMessage(mixed row)

Whether any of the columns in the row has a message

Parameters:
row - the data object to use to check the column for messages.
Returns:
true if any of the columns in the row has a message, otherwise false.

/Swat/SwatTableView.php at line 1372

setDefaultOrderbyColumn

public void setDefaultOrderbyColumn(mixed column, integer direction, SwatTableViewOrderableColumn the)

Sets a default column to use for ordering the data of this table-view

Parameters:
the - column in this view to use for default ordering
direction - the default direction of the ordered column.
Throws:
SwatException
See Also:
SwatTableView::$default_orderby_column

/Swat/SwatTableView.php at line 706

setDescendantStates

public void setDescendantStates(array states)

Sets descendant states

Sets states on all stateful UI-objects in the widget subtree below this table-view.

Parameters:
states - an array of UI-object states with UI-object identifiers as array keys.

/Swat/SwatTableView.php at line 1395

validateColumn

protected void validateColumn(SwatTableViewColumn column)

Ensures a column added to this table-view is valid for this table-view

Parameters:
column - the column to check.
Throws:
if the column has the same id as a column already in this table-view.

/Swat/SwatTableView.php at line 1652

validateGroup

protected void validateGroup(SwatTableViewGroup group)

Ensures a group added to this table-view is valid for this table-view

Parameters:
group - the group to check.
Throws:
if the group has the same id as a group already in this table-view.

/Swat/SwatTableView.php at line 1834

validateRow

protected void validateRow(SwatTableViewRow row)

Ensures a row added to this table-view is valid for this table-view

Parameters:
row - the row to check.
Throws:
if the row has the same id as a row already in this table-view.
if the row is an input row and this table-view already contains an input-row.

silverorange Code