mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-12 16:05:43 +00:00
add selectFirstRowByDefault for tables
This commit is contained in:
@@ -127,7 +127,8 @@
|
||||
mounted = true
|
||||
})
|
||||
|
||||
$: selectedRowIndex === -1 &&
|
||||
$: resolvedConfig?.selectFirstRowByDefault != false &&
|
||||
selectedRowIndex === -1 &&
|
||||
Array.isArray(result) &&
|
||||
result.length > 0 &&
|
||||
// We need to wait until the component is mounted so the world is created
|
||||
@@ -208,7 +209,9 @@
|
||||
|
||||
if (result) {
|
||||
//console.log('rerendering table', result[0])
|
||||
toggleRow({ original: filteredResult[0] }, true)
|
||||
if (resolvedConfig?.selectFirstRowByDefault != false) {
|
||||
toggleRow({ original: filteredResult[0] }, true)
|
||||
}
|
||||
}
|
||||
|
||||
if (outputs.page.peak()) {
|
||||
|
||||
@@ -1534,6 +1534,12 @@ This is a paragraph.
|
||||
value: {},
|
||||
tooltip:
|
||||
'any configuration that can be passed to the tanstack table component as initial state (https://tanstack.com/table/v8/docs/api/core/table#initialstate)'
|
||||
},
|
||||
selectFirstRowByDefault: {
|
||||
type: 'static',
|
||||
fieldType: 'boolean',
|
||||
value: true as boolean,
|
||||
tooltip: 'Select the first row by default on start'
|
||||
}
|
||||
},
|
||||
componentInput: {
|
||||
|
||||
Reference in New Issue
Block a user