fix(Computer): ✨ update selectFirstRowOnMount logic
* Introduce selectFirstRowOnMount to manage row selection on component mount. * Update useEffect dependencies to include selectFirstRowOnMount. * Ensure first row selection logic handles cases where keyField is not defined.
This commit is contained in:
@@ -36,6 +36,7 @@ function _GlidlerAPIAdaptorForGoLangv2<T = unknown>(props: GlidlerAPIAdaptorForG
|
||||
const searchStr = getState('searchStr');
|
||||
const searchFields = getState('searchFields');
|
||||
const _active_requests = getState('_active_requests');
|
||||
const keyField = getState('keyField');
|
||||
setState('loadingData', true);
|
||||
try {
|
||||
//console.log('APIAdaptorGoLangv2', { _active_requests, index, pageSize, props });
|
||||
@@ -113,6 +114,12 @@ function _GlidlerAPIAdaptorForGoLangv2<T = unknown>(props: GlidlerAPIAdaptorForG
|
||||
col_ids?.push(props.hotfields.join(','));
|
||||
}
|
||||
|
||||
if (keyField) {
|
||||
if (!col_ids.includes(keyField)) {
|
||||
col_ids.push(keyField);
|
||||
}
|
||||
}
|
||||
|
||||
if (col_ids && col_ids.length > 0) {
|
||||
ops.push({
|
||||
type: 'select-fields',
|
||||
|
||||
Reference in New Issue
Block a user