mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-25 21:15:59 +00:00
added loadingformview
This commit is contained in:
34
packages/web/src/formview/JslFormView.svelte
Normal file
34
packages/web/src/formview/JslFormView.svelte
Normal file
@@ -0,0 +1,34 @@
|
||||
<script lang="ts" context="module">
|
||||
async function loadRow(props, index) {
|
||||
const { jslid, formatterFunction, display } = props;
|
||||
|
||||
const response = await apiCall('jsldata/get-rows', {
|
||||
jslid,
|
||||
offset: index,
|
||||
limit: 1,
|
||||
formatterFunction,
|
||||
filters: display ? display.compileFilters() : null,
|
||||
});
|
||||
|
||||
if (response.errorMessage) return response;
|
||||
return response.rows[0];
|
||||
}
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import { apiCall } from '../utility/api';
|
||||
import _ from 'lodash';
|
||||
import LoadingFormView from './LoadingFormView.svelte';
|
||||
|
||||
export let display;
|
||||
|
||||
async function handleLoadRow() {
|
||||
return await loadRow($$props, display.config.formViewRecordNumber || 0);
|
||||
}
|
||||
|
||||
async function handleLoadRowCount() {
|
||||
return null;
|
||||
}
|
||||
</script>
|
||||
|
||||
<LoadingFormView {...$$props} loadRowFunc={handleLoadRow} loadRowCountFunc={handleLoadRowCount} />
|
||||
Reference in New Issue
Block a user