Wt: Wt::WTableRow Class Reference

Wt 4.10.4

Loading...
Searching...
No Matches
Public Member Functions | List of all members
Wt::WTableRow Class Reference

A table row. More...

`#include <Wt/WTableRow.h>`

Inheritance diagram for Wt::WTableRow:
[legend]

## Public Member Functions
| WTableRow ()
| Creates a new table row.
virtual | ~WTableRow ()
| Destructor.
WTable * | table () const
| Returns the table to which this row belongs.
WTableCell * | elementAt (int column)
| Access the row element at the given column.
int | rowNum () const
| Returns the row number of this row in the table.
void | setHeight (const WLength &height)
| Sets the row height.
WLength | height () const
| Returns the row height.
void | setStyleClass (const WString &style)
| Sets the CSS style class for this row.
const WString & | styleClass () const
| Returns the CSS style class for this row.
void | setHidden (bool how)
| Sets whether the row must be hidden.
bool | isHidden () const
| Returns whether the rows is hidden.
void | hide ()
| Hides the row.
void | show ()
| Shows the row.
void | setId (const std::string &id)
| Sets the CSS Id.
virtual const std::string | id () const override
| Returns the (unique) identifier for this object.
Public Member Functions inherited from Wt::WObject
void | addChild (std::unique_ptr< WObject > child)
| Add a child WObject whose lifetime is determined by this WObject.
template<typename Child >
Child * | addChild (std::unique_ptr< Child > child)
| Add a child WObject, returning a raw pointer.
std::unique_ptr< WObject > | removeChild (WObject *child)
| Remove a child WObject, so its lifetime is no longer determined by this WObject.
template<typename Child >
std::unique_ptr< Child > | removeChild (Child *child)
| Remove a child WObject, so its lifetime is no longer determined by this WObject.
virtual void | setObjectName (const std::string &name)
| Sets an object name.
virtual std::string | objectName () const
| Returns the object name.
void | resetLearnedSlots ()
| Resets learned stateless slot implementations.
template<class T >
void | resetLearnedSlot (void(T::*method)())
| Resets a learned stateless slot implementation.
template<class T >
WStatelessSlot * | implementStateless (void(T::*method)())
| Declares a slot to be stateless and learn client-side behaviour on first invocation.
template<class T >
WStatelessSlot * | implementStateless (void(T::*method)(), void(T::*undoMethod)())
| Declares a slot to be stateless and learn client-side behaviour in advance.
void | isNotStateless ()
| Marks the current function as not stateless.
template<class T >
WStatelessSlot * | implementJavaScript (void(T::*method)(), const std::string &jsCode)
| Provides a JavaScript implementation for a method.
Public Member Functions inherited from Wt::Core::observable
| observable () noexcept
| Default constructor.
virtual | ~observable ()
| Destructor.
template<typename... Args, typename C >
auto | bindSafe (void(C::*method)(Args...)) noexcept
| Protects a method call against object destruction.
template<typename... Args, typename C >
auto | bindSafe (void(C::*method)(Args...) const) const noexcept
| Protects a const method call against object destruction.
template<typename Function >
auto | bindSafe (const Function &function) noexcept
| Protects a function against object destruction.

## Additional Inherited Members
Public Types inherited from Wt::WObject
typedef void(WObject::*) | Method()
| Typedef for a WObject method without arguments.
Static Public Member Functions inherited from Wt::WObject
Protected Member Functions inherited from Wt::WObject
virtual WStatelessSlot * | getStateless (Method method)
| On-demand stateless slot implementation.

## Detailed Description

A table row.

A WTableRow is returned by WTable::rowAt() and managing various properties of a single row in a table (it is however not a widget).

A table row corresponds to the HTML `<tr>` tag.

See also
  WTable, WTableColumn

## Constructor & Destructor Documentation

## ◆ WTableRow()

Wt::WTableRow::WTableRow | ( |  | ) |

Creates a new table row.

Table rows must be added to a table using WTable::insertRow() before you can access contents in it using elementAt().

## Member Function Documentation

## ◆ elementAt()

WTableCell * Wt::WTableRow::elementAt | ( | int | column | ) |

Access the row element at the given column.

Like WTable::elementAt(), if the column is beyond the current table dimensions, then the table is expanded automatically.

The row must be inserted within a table first.

## ◆ height()

WLength Wt::WTableRow::height | ( |  | ) | const

Returns the row height.

See also
  setHeight(const WLength&)

## ◆ hide()

void Wt::WTableRow::hide | ( |  | ) |

Hides the row.

See also
  setHidden()

## ◆ id()

virtual const std::string Wt::WTableRow::id | ( |  | ) | const
| overridevirtual

Returns the (unique) identifier for this object.

For a WWidget, this corresponds to the id of the DOM element that represents the widget. This is not entirely unique, since a composite widget shares the same id as its implementation.

By default, the id is auto-generated, unless a custom id is set for a widget using WWidget::setId().

See also
  WWidget::jsRef()

Reimplemented from Wt::WObject.

## ◆ isHidden()

bool Wt::WTableRow::isHidden | ( |  | ) | const

Returns whether the rows is hidden.

See also
  setHidden()

## ◆ rowNum()

int Wt::WTableRow::rowNum | ( |  | ) | const

Returns the row number of this row in the table.

Returns -1 if the row is not yet part of a table.

See also
  WTable::rowAt()

## ◆ setHeight()

void Wt::WTableRow::setHeight | ( | const WLength & | height | ) |

Sets the row height.

The default row height is WLength::Auto.

See also
  height(), WWidget::resize()

## ◆ setHidden()

void Wt::WTableRow::setHidden | ( | bool | how | ) |

Sets whether the row must be hidden.

Hide or show the row.

The default value is `false` (row is not hidden).

See also
  hide(), show()

## ◆ setId()

void Wt::WTableRow::setId | ( | const std::string & | id | ) |

Sets the CSS Id.

Sets a custom Id. Note that the Id must be unique across the whole widget tree, can only be set right after construction and cannot be changed.

See also
  WObject::id()

## ◆ setStyleClass()

void Wt::WTableRow::setStyleClass | ( | const WString & | style | ) |

Sets the CSS style class for this row.

The style is inherited by all table cells in this row.

See also
  styleClass(), WWidget::setStyleClass()

## ◆ show()

void Wt::WTableRow::show | ( |  | ) |

Shows the row.

See also
  setHidden()

## ◆ styleClass()

const WString & Wt::WTableRow::styleClass | ( |  | ) | const

Returns the CSS style class for this row.

See also
  styleClass(), WWidget::styleClass()

## ◆ table()

WTable * Wt::WTableRow::table | ( |  | ) | const

Returns the table to which this row belongs.

See also
  WTable::rowAt()