Jet\UI_dataGrid_column

This subelement of the UI_dataGrid element has a special role. Of course, it is a rederer that is in charge of a specific column of the data listing.

However, it also represents the definition of this column. Thus, it defines not only what the column title will be, but also what data key will be displayed in the column. Last but not least, it also defines whether or not the data can be sorted by the column and indicates whether the data is sorted by the column.

Dědí od Jet\UI_Renderer_Single

Overview of methods

Method Meaning of
public __construct(
UI_dataGrid $grid,
string $name,
string $title
)
Parameters
  • $grid
    Grid to which the column belongs
  • $name
    Column name - its identification and data key.
  • $title
    Column title (heading)
public getGrid(
) : UI_dataGrid
Returns the grid to which the column belongs.
public getName(
) : string
Returns the column name - its identification and data key.
public setRenderer(
callable $renderer
) : static
Important method
Sets a rederer - e.g. an anonymous function that takes care of displaying the specific content of the given column and row.

The prototype function is: function( array|object $row_itemint $row_index ) : void
{
     
//... ... ... 
    
echo $item->getSomeData();
     
//... ... ... 
}
public getRenderer(
) : callable
Returns the renderer - see the setRenderer method.
public getTitle(
) : string
Returns the set column header.
public setTitle(
string $title
) : static
Sets the column header.
public setAllowSort(
bool $allow_order_by
) : static
Sets whether or not sorting by date column is allowed.
public getAllowSort(
) : bool
Indicates whether or not sorting by date column is allowed.
public isSortByAsc(
) : bool
Indicates whether the data is currently sorted by the given column - ascending.
public isSortByDesc(
) : bool
Indicates whether the data is currently sorted by the column - descending.
Previous chapter
Jet\UI_dataGrid
Next chapter
Jet\UI_dataGrid_header