A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/bootstrap-vue/bootstrap-vue/commit/86c53dd below:

add `selectAllRows()` and `clearSelected()` to thead/t… · bootstrap-vue/bootstrap-vue@86c53dd · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+25

-11

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+25

-11

lines changed Original file line number Diff line number Diff line change

@@ -1070,11 +1070,13 @@ footer cells that do not have an explicit scoped slot provided.

1070 1070

The slots can be optionally scoped (`data` in the above example), and will have the following

1071 1071

properties:

1072 1072 1073 -

| Property | Type | Description |

1074 -

| -------- | ------ | ------------------------------------------------------------- |

1075 -

| `column` | String | The fields's `key` value |

1076 -

| `field` | Object | the field's object (from the `fields` prop) |

1077 -

| `label` | String | The fields label value (also available as `data.field.label`) |

1073 +

| Property | Type | Description |

1074 +

| --------------- | ------ | ----------------------------------------------------------------------------------------- |

1075 +

| `column` | String | The fields's `key` value |

1076 +

| `field` | Object | the field's object (from the `fields` prop) |

1077 +

| `label` | String | The fields label value (also available as `data.field.label`) |

1078 +

| `selectAllRows` | Method | Select all rows (applicable if the table is in [`selectable`](#row-select-support) mode |

1079 +

| `clearSelected` | Method | Unselect all rows (applicable if the table is in [`selectable`](#row-select-support) mode |

1078 1080 1079 1081

When placing inputs, buttons, selects or links within a `HEAD[...]` or `FOOT[...]` slot, note that

1080 1082

`head-clicked` event will not be emitted when the input, select, textarea is clicked (unless they

@@ -1138,10 +1140,12 @@ rather than native browser table child elements.

1138 1140 1139 1141

Slot `thead-top` can be optionally scoped, receiving an object with the following properties:

1140 1142 1141 -

| Property | Type | Description |

1142 -

| --------- | ------ | ----------------------------------------------------------------------------- |

1143 -

| `columns` | Number | The number of columns in the rendered table |

1144 -

| `fields` | Array | Array of field definition objects (normalized to the array of objects format) |

1143 +

| Property | Type | Description |

1144 +

| --------------- | ------ | ----------------------------------------------------------------------------------------- |

1145 +

| `columns` | Number | The number of columns in the rendered table |

1146 +

| `fields` | Array | Array of field definition objects (normalized to the array of objects format) |

1147 +

| `selectAllRows` | Method | Select all rows (applicable if the table is in [`selectable`](#row-select-support) mode |

1148 +

| `clearSelected` | Method | Unselect all rows (applicable if the table is in [`selectable`](#row-select-support) mode |

1145 1149 1146 1150

## Custom empty and emptyfiltered rendering via slots

1147 1151 Original file line number Diff line number Diff line change

@@ -55,6 +55,10 @@ export default {

55 55

return h()

56 56

}

57 57 58 +

// Refernce to `selectAllRows` and `clearSelected()`, if table is Selectable

59 +

const selectAllRows = this.isSelectable ? this.selectAllRows : () => {}

60 +

const clearSelected = this.isSelectable ? this.clearSelected : () => {}

61 + 58 62

// Helper function to generate a field <th> cell

59 63

const makeCell = (field, colIndex) => {

60 64

let ariaLabel = null

@@ -116,7 +120,10 @@ export default {

116 120

label: field.label,

117 121

column: field.key,

118 122

field,

119 -

isFoot

123 +

isFoot,

124 +

// Add in row select methods

125 +

selectAllRows,

126 +

clearSelected

120 127

})

121 128

if (!slot) {

122 129

// need to check if this will work

@@ -135,7 +142,10 @@ export default {

135 142

} else {

136 143

const scope = {

137 144

columns: fields.length,

138 -

fields: fields

145 +

fields: fields,

146 +

// Add in row select methods

147 +

selectAllRows,

148 +

clearSelected

139 149

}

140 150

$trs.push(this.normalizeSlot('thead-top', scope) || h())

141 151

$trs.push(h(BTr, { class: this.theadTrClass }, $cells))

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4