Back to Joomla project (class list)

Class Grid - list of methods

Utility class for creating HTML Grids

Direct known subclasses

Package: Joomla\CMS\HTML\Helpers
Copyright: (C) 2011 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
Located at: Joomla/HTML/Helpers/Grid.php
Project: Joomla

Method Summary

public static string
(mixed $title, mixed $order, mixed $direction = 'asc', mixed $selected = '', mixed $task = null, mixed $newDirection = 'asc', mixed $tip = '', mixed $form = null)

Method to sort a column in a grid
Parameters
  • string $title The link title
  • string $order The order field for the column
  • string $direction The current direction
  • string $selected The selected ordering
  • string $task An optional task override
  • string $newDirection An optional direction for the new column
  • string $tip An optional text shown as tooltip title instead of $title
  • string $form An optional form selector
Returns
  • string
Since
  • 1.5
Show source code of this method: sort Source Code

public static string
(mixed $name = 'checkall-toggle', mixed $action = 'Joomla.checkAll(this)')

Method to check all checkboxes in a grid
Parameters
  • string $name The name of the form element
  • string $action The action to perform on clicking the checkbox
Returns
  • string
Since
  • 3.1.2
Show source code of this method: checkall Source Code

public static mixed
(mixed $rowNum, mixed $recId, mixed $checkedOut = false, mixed $name = 'cid', mixed $stub = 'cb', mixed $title = '', mixed $formId = null)

Method to create a checkbox for a grid row.
Parameters
  • int $rowNum The row index
  • int $recId The record id
  • bool $checkedOut True if item is checked out
  • string $name The name of the form element
  • string $stub The name of stub identifier
  • string $title The name of the item
  • string $formId An optional form selector.
Returns
  • mixed String of html with a checkbox if item is not checked out, null if checked out.
Since
  • 1.5
Show source code of this method: id Source Code

public static string
(mixed &$row, mixed $i, mixed $identifier = 'id')

Displays a checked out icon.
Parameters
  • object $row A data object (must contain checked out as a property).
  • int $i The index of the row.
  • string $identifier The property name of the primary key or index of the row.
Returns
  • string
Since
  • 1.5
Show source code of this method: checkedOut Source Code

public static string
(mixed $value, mixed $i, mixed $img1 = 'tick.png', mixed $img0 = 'publish_x.png', mixed $prefix = '')

Method to create a clickable icon to change the state of an item
Parameters
  • mixed $value Either the scalar value or an object (for backward compatibility, deprecated)
  • int $i The index
  • string $img1 Image for a positive or on value
  • string $img0 Image for the empty or off value
  • string $prefix An optional prefix for the task
Returns
  • string
Since
  • 1.5
Show source code of this method: published Source Code

public static string
(mixed $filterState = '*', mixed $published = 'JPUBLISHED', mixed $unpublished = 'JUNPUBLISHED', mixed $archived = null, mixed $trashed = null)

Method to create a select list of states for filtering By default the filter shows only published and unpublished items
Parameters
  • string $filterState The initial filter state
  • string $published The Text string for published
  • string $unpublished The Text string for Unpublished
  • string $archived The Text string for Archived
  • string $trashed The Text string for Trashed
Returns
  • string
Since
  • 1.5
Show source code of this method: state Source Code

public static string
(mixed $rows, mixed $image = 'filesave.png', mixed $task = 'saveorder')

Method to create an icon for saving a new ordering in a grid
Parameters
  • array $rows The array of rows of rows
  • string $image The image [UNUSED]
  • string $task The task to use, defaults to save order
Returns
  • string
Since
  • 1.5
Show source code of this method: order Source Code

protected static string
(mixed &$row, mixed $overlib = true)

Method to create a checked out icon with optional overlib in a grid.
Parameters
  • object $row The row object
  • bool $overlib True if an overlib with checkout information should be created.
Returns
  • string HTMl for the icon and overlib
Since
  • 1.5
Show source code of this method: _checkedOut Source Code

Tags Summary

Since
1.5