You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sample of grid as component and theme component
Took some work at work removed some parts.
Update for : #29
SimpleHtmlGrid.tsx
import{GridInterface}from"@simple-html/grid";import"@simple-html/grid";import"@simple-html/grid/dist/grid.css";import"@simple-html/grid/dist/date.css";importReact,{useEffect,useRef}from"react";/** * This is just a grid container, so I can use the vanilla grid in react * this also added some features like double click on grid row * PS! editing this with hot reloading will create weird behavior */exportfunctionSimpleHtmlGrid(props: {id: string;style?: {width?: string;height?: string};interface: GridInterface<any>;className?: string;date?: any;}){constref=useRef<any>(null);useEffect(()=>{if(ref.current){// dom element does not have final size on first call to useEffectsetTimeout(()=>{ref.current.enableCleanup=true;// fixes issue hmr can generate/or just bad cleanup from reactref.current.connectInterface(props.interface);},0);}return()=>{if(ref.current){console.log("unexpected behavior, duplicate grid",ref.current);}};},[]);return(// eslint-disable-next-line @typescript-eslint/ban-ts-comment// @ts-ignore<simple-html-gridid={props.id}ref={ref}style={{width: props.style?.width,height: props.style?.height}}class={props.className}/>);}
Sample of grid as component and theme component
Took some work at work removed some parts.
Update for : #29
SimpleHtmlGrid.tsx
SetGridTheme.tsx
The text was updated successfully, but these errors were encountered: