Namespace metawidget.widgetbuilder
WidgetBuilders.
Defined in: metawidget-widgetbuilders.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
<static> |
metawidget.widgetbuilder.addColumn(tr, value, row, columnAttributes, elementName, tableAttributes, mw)
Add a column to the given row, displaying the given value.
|
<static> |
metawidget.widgetbuilder.addFooterRow(tfoot, columnAttributes)
|
<static> |
metawidget.widgetbuilder.addHeader(tr, attributes, mw)
Add a header column for the given attributes.
|
<static> |
metawidget.widgetbuilder.addHeaderRow(inspectionResultProperties, inspectionResultProperties, mw)
Adds a row to the table header.
|
<static> |
metawidget.widgetbuilder.addRow(columnAttributesArray, value, row, columnAttributesArray, elementName, tableAttributes, mw)
Adds a row to the table body.
|
<static> |
metawidget.widgetbuilder.buildWidget(elementName, attributes, mw)
|
<static> |
metawidget.widgetbuilder.createTable(elementName, attributes, mw)
Create a table populated with the contents of an array property.
|
<static> |
metawidget.widgetbuilder.HtmlWidgetBuilder(config)
WidgetBuilder for pure JavaScript environments.
|
Method Detail
<static>
metawidget.widgetbuilder.addColumn(tr, value, row, columnAttributes, elementName, tableAttributes, mw)
Add a column to the given row, displaying the given value. Subclasses
may override this method to modify the column contents (for example,
to wrap them in an anchor tag).
- Parameters:
- tr
- value
- row
- columnAttributes
- elementName
- tableAttributes
- mw
- Returns:
- the added column, or undefined if no column was added. This can be useful for subclasses
<static>
metawidget.widgetbuilder.addFooterRow(tfoot, columnAttributes)
- Parameters:
- tfoot
- columnAttributes
<static>
metawidget.widgetbuilder.addHeader(tr, attributes, mw)
Add a header column for the given attributes. Subclasses may override
this method to suppress certain columns. By default, suppresses
columns where 'hidden' is true.
- Parameters:
- tr
- attributes
- mw
- Returns:
- true if a header was added, false otherwise
<static>
metawidget.widgetbuilder.addHeaderRow(inspectionResultProperties, inspectionResultProperties, mw)
Adds a row to the table header. Subclasses may override this method
to add additional columns, or suppress the header row.
- Parameters:
- inspectionResultProperties
- an array of sorted inspection result properties
- inspectionResultProperties
- mw
- Returns:
- array of column attributes. For example, columnAttributes[0] contains an object containing attributes for the first column
<static>
metawidget.widgetbuilder.addRow(columnAttributesArray, value, row, columnAttributesArray, elementName, tableAttributes, mw)
Adds a row to the table body. Subclasses may override this method to
add additional columns, or suppress the row.
- Parameters:
- columnAttributesArray
- array of column attributes. For example, columnAttributesArray[0] contains an object containing columnAttributes for the first column
- value
- row
- columnAttributesArray
- elementName
- tableAttributes
- mw
- Returns:
- the added row, or undefined if no row was added. This can be useful for subclasses
<static>
metawidget.widgetbuilder.buildWidget(elementName, attributes, mw)
- Parameters:
- elementName
- attributes
- mw
<static>
metawidget.widgetbuilder.createTable(elementName, attributes, mw)
Create a table populated with the contents of an array property.
Subclasses may override this method to customize table creation. Alternatively, they could override one of the sub-methods addHeaderRow, addHeader, addRow or addColumn.
- Parameters:
- elementName
- attributes
- mw
<static>
metawidget.widgetbuilder.HtmlWidgetBuilder(config)
WidgetBuilder for pure JavaScript environments.
Creates native HTML 5 widgets, such as input
and
select
, to suit the inspected fields.
This WidgetBuilder can be configured with the following settings:
- alwaysUseNestedMetawidgetInTables - by default, HtmlWidgetBuilder will render simple values in tables as read-only labels. It will only resort to using nested Metawidgets inside tables if the value is an object. However, sometimes using a nested Metawidget is the desired behaviour, even for simple values. Setting this flag forces this
- Parameters:
- config