-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1646 from BEXIS2/747-replace-primary-data-telerik…
…-table_2 #747 add a test page for new table with data - server side
- Loading branch information
Showing
17 changed files
with
196 additions
and
223 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 22 additions & 25 deletions
47
Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI.Svelte/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI.Svelte/src/routes/test/+page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { setApiConfig } from '@bexis2/bexis2-core-ui'; | ||
|
||
/** @type {import('./$types').PageLoad} */ | ||
export function load() { | ||
if (import.meta.env.DEV) { | ||
console.log('dev'); | ||
setApiConfig('https://localhost:44345', 'davidschoene', '123456'); | ||
} | ||
|
||
return {}; | ||
} |
66 changes: 44 additions & 22 deletions
66
Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI.Svelte/src/routes/test/+page.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,52 @@ | ||
<script lang="ts"> | ||
import { SlideToggle } from '@skeletonlabs/skeleton'; | ||
import type { fileInfoType } from '@bexis2/bexis2-core-ui'; | ||
import { Api } from '@bexis2/bexis2-core-ui'; | ||
import { setApiConfig } from '@bexis2/bexis2-core-ui'; | ||
import { onMount } from 'svelte'; | ||
onMount(async () => { | ||
console.log('start entity template'); | ||
// setApiConfig("https://localhost:44345","davidschoene","123456"); | ||
try { | ||
const response = await Api.get('/dcm/entitytemplates/Load'); | ||
console.log('data', response.data); | ||
} catch (error) { | ||
console.error(error); | ||
import { Page, Table, type TableConfig } from '@bexis2/bexis2-core-ui'; | ||
import { host, username, password } from '@bexis2/bexis2-core-ui'; | ||
import { writable } from 'svelte/store'; | ||
import { getToken } from '$services/BaseCaller'; | ||
// load attributes from div | ||
let container; | ||
let id:number|undefined = undefined; | ||
type ServerTableType = { | ||
id: number; | ||
name: string; | ||
}; | ||
let serverTableConfig: TableConfig<ServerTableType>; | ||
$:serverTableConfig; | ||
let t:string = ""; | ||
load(); | ||
async function load() { | ||
// get data from parent | ||
container = document.getElementById('test'); | ||
id = Number(container?.getAttribute('dataset')); | ||
const tableStore = writable<any[]>([]); | ||
const url = host+"/api/datatable/" | ||
t = await getToken(); | ||
serverTableConfig = { | ||
id: 'serverTable', // a unique id for the table | ||
entityId: id, // dataset ID | ||
versionId: -1, // vesion ID | ||
data: tableStore, // store to hold and retrieve data | ||
serverSide: true, // serverSide needs to be set to true | ||
// URL for the table to be fetched from | ||
URL: url, | ||
token: t // API token to access the datasets | ||
}; | ||
console.log(url,t,id, serverTableConfig) | ||
} | ||
}); | ||
$: toggle = false; | ||
</script> | ||
|
||
<h1>Test with layout</h1> | ||
|
||
<SlideToggle name="david" bind:checked={toggle} /> | ||
<br /> | ||
<Page> | ||
|
||
{#if serverTableConfig} | ||
<Table config={serverTableConfig} /> | ||
{/if} | ||
|
||
<b>toggle : {toggle}</b> | ||
</Page> |
Oops, something went wrong.