help

I have a onclick props, why <for each> doesnt display the record?
No description
No description
No description
7 Replies
M7
M715mo ago
what is "RightDesign" component?
navi.ToTskie
navi.ToTskieOP15mo ago
an Onclick
No description
navi.ToTskie
navi.ToTskieOP15mo ago
i solved this prob using vanilajs instead like this
navi.ToTskie
navi.ToTskieOP15mo ago
No description
M7
M715mo ago
so you have button with onClick and by clicking on the button you want to do what? i see..
navi.ToTskie
navi.ToTskieOP15mo ago
i like to do window.print
M7
M715mo ago
usually you do that differently in frameworks.. something like:
const [html, setHtml] = createSignal(null);
const onClick = function onButtonClick() {
const students = await (await fetch(...)).json();
setHtml(<table ..../>);
}
return <main...>
...
{html()}
...
</main>
const [html, setHtml] = createSignal(null);
const onClick = function onButtonClick() {
const students = await (await fetch(...)).json();
setHtml(<table ..../>);
}
return <main...>
...
{html()}
...
</main>
something like this, there are also other patterns with createResource etc. But ur also calling print, so not sure what exactly your trying to accomplish.. may be rendering html in an iframe and printing content of iframe is what you are looking for?.. idk what is your task..
Want results from more Discord servers?
Add your server