DataTableChildren
class DataTableChildren
kotlin.Any | |
↳ | androidx.ui.material.DataTableChildren |
Collects information about the children of a DataTable when its body is executed with a DataTableChildren as argument.
Summary
Public methods |
|
---|---|
Unit |
dataRow(selected: Boolean = false, onSelectedChange: (Boolean) -> Unit = null, children: (index: Int) -> Unit) Creates a data row in a DataTable with the given content. |
Unit |
dataRow(text: (index: Int) -> String, icon: (index: Int) -> Image? = { null }, selected: Boolean = false, onSelectedChange: (Boolean) -> Unit = null) Creates a data row in a DataTable with a text and an optional icon. |
Unit |
Creates a header row in a DataTable with the given content. |
Unit |
headerRow(text: (index: Int) -> String, icon: (index: Int) -> Image? = { null }, onSelectAll: (Boolean) -> Unit = null) Creates a header row in a DataTable with a text and an optional icon. |
Public methods
dataRow
fun dataRow(
selected: Boolean = false,
onSelectedChange: (Boolean) -> Unit = null,
children: (index: Int) -> Unit
): Unit
Creates a data row in a DataTable with the given content.
If onSelectedChange is non-null for any row in the table, then a checkbox is shown at the start of each row. The checkbox will be checked if and only if the row is selected (true).
Parameters | |
---|---|
selected: Boolean = false | Whether this row is selected. |
onSelectedChange: (Boolean) -> Unit = null | Called when a user selects or unselects this row. |
dataRow
fun dataRow(
text: (index: Int) -> String,
icon: (index: Int) -> Image? = { null },
selected: Boolean = false,
onSelectedChange: (Boolean) -> Unit = null
): Unit
Creates a data row in a DataTable with a text and an optional icon.
If onSelectedChange is non-null for any row in the table, then a checkbox is shown at the start of each row. The checkbox will be checked if and only if the row is selected (true).
Parameters | |
---|---|
text: (index: Int) -> String | Text to display in each cell. |
icon: (index: Int) -> Image? = { null } | Optional image to draw to the left of the text in each cell. |
selected: Boolean = false | Whether this row is selected. |
onSelectedChange: (Boolean) -> Unit = null | Called when a user selects or unselects this row. |
headerRow
fun headerRow(
onSelectAll: (Boolean) -> Unit = null,
children: (index: Int) -> Unit
): Unit
Creates a header row in a DataTable with the given content.
Note that the onSelectAll callback may be null, in which case the default behaviour will be used, i.e. select or unselect all selectable rows using their onSelectedChange callbacks.
Parameters | |
---|---|
onSelectAll: (Boolean) -> Unit = null | Called when a user selects or unselects all rows using the 'all' checkbox. |
headerRow
fun headerRow(
text: (index: Int) -> String,
icon: (index: Int) -> Image? = { null },
onSelectAll: (Boolean) -> Unit = null
): Unit
Creates a header row in a DataTable with a text and an optional icon.
Note that the onSelectAll callback may be null, in which case the default behaviour will be used, i.e. select or unselect all selectable rows using their onSelectedChange callbacks.
Parameters | |
---|---|
text: (index: Int) -> String | Text to display in each column header |
icon: (index: Int) -> Image? = { null } | Optional image to draw to the left of the text in each column header. |
onSelectAll: (Boolean) -> Unit = null | Called when a user selects or unselects all rows using the 'all' checkbox. |