Skip to content

Instantly share code, notes, and snippets.

@bangonkali
Created August 17, 2023 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bangonkali/bca63f3197f50d837364ffdda78674c7 to your computer and use it in GitHub Desktop.
Save bangonkali/bca63f3197f50d837364ffdda78674c7 to your computer and use it in GitHub Desktop.
Fix for commonJS
/** @jsxImportSource react */
import { qwikify$ } from "@builder.io/qwik-react";
import * as SyncfusionDropDown from '@syncfusion/ej2-react-dropdowns';
import * as SyncfusionBase from '@syncfusion/ej2-base';
export const SyncfusionDemo = qwikify$(() => {
SyncfusionBase.registerLicense(import.meta.env.PUBLIC_SYNCFUSION_LICENSE_KEY);
const data: { [key: string]: Object }[] = [
{
nodeId: '01', nodeText: 'Music',
nodeChild: [
{ nodeId: '01-01', nodeText: 'Gouttes.mp3' }
]
},
{
nodeId: '02', nodeText: 'Videos', expanded: true,
nodeChild: [
{ nodeId: '02-01', nodeText: 'Naturals.mp4' },
{ nodeId: '02-02', nodeText: 'Wild.mpeg' },
]
},
{
nodeId: '03', nodeText: 'Documents',
nodeChild: [
{ nodeId: '03-01', nodeText: 'Environment Pollution.docx' },
{ nodeId: '03-02', nodeText: 'Global Water, Sanitation, & Hygiene.docx' },
{ nodeId: '03-03', nodeText: 'Global Warming.ppt' },
{ nodeId: '03-04', nodeText: 'Social Network.pdf' },
{ nodeId: '03-05', nodeText: 'Youth Empowerment.pdf' },
]
},
];
const fields: Object = { dataSource: data, value: 'nodeId', text: 'nodeText', child: 'nodeChild' };
return (
<div className="syncfusion-container">
<p>Syncfusion Dropdown</p>
<SyncfusionDropDown.DropDownTreeComponent id="dropdowntree" fields={fields} />
</div>
);
}, { eagerness: "load", clientOnly: true });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment