How check the state of individual checkbox in reactjs (material-table and windmill-ui)

2021.12.09 10:53 SnooJokes7475 How check the state of individual checkbox in reactjs (material-table and windmill-ui)


I am having a table which will contain list of students fetched from a database. When I click each student row a modal popup will be shown containing another table of 4 rows and 3 columns. Each column in the modal will contain 4 checkboxes. When I click a checkbox I want to change the status column of that row from 'pending' to 'paid' and also the the badge property type from 'danger' to 'success'. The problem is when I click a checkbox it changes all the columns status from 'pending' to 'paid' instead of just changing that single single row.
Here is my code

import { Table, TableBody, TableCell, Badge, TableFooter, TableRow, TableHeader, TableContainer, Input, Modal, ModalHeader, ModalBody, ModalFooter, Button, } from "@windmill/react-ui"; import MaterialTable from "material-table"; import AddBox from "@material-ui/icons/AddBox"; import ArrowDownward from "@material-ui/icons/ArrowDownward"; import Check from "@material-ui/icons/Check"; import ChevronLeft from "@material-ui/icons/ChevronLeft"; import ChevronRight from "@material-ui/icons/ChevronRight"; import Clear from "@material-ui/icons/Clear"; import DeleteOutline from "@material-ui/icons/DeleteOutline"; import Edit from "@material-ui/icons/Edit"; import FilterList from "@material-ui/icons/FilterList"; import FirstPage from "@material-ui/icons/FirstPage"; import LastPage from "@material-ui/icons/LastPage"; import Remove from "@material-ui/icons/Remove"; import SaveAlt from "@material-ui/icons/SaveAlt"; import Search from "@material-ui/icons/Search"; import ViewColumn from "@material-ui/icons/ViewColumn"; import React, { forwardRef, useState } from "react"; const Admin = () => { const [isModalOpen, setIsModalOpen] = useState(false); const [id, setId] = useState(""); function openModal(ids) { setId(ids.studentId); setIsModalOpen(true); } function closeModal() { setIsModalOpen(false); } const tableIcons = { Add: forwardRef((props, ref) => ), Check: forwardRef((props, ref) => ), Clear: forwardRef((props, ref) => ), Delete: forwardRef((props, ref) => ), DetailPanel: forwardRef((props, ref) => (  )), Edit: forwardRef((props, ref) => ), Export: forwardRef((props, ref) => ), Filter: forwardRef((props, ref) => ), FirstPage: forwardRef((props, ref) => ), LastPage: forwardRef((props, ref) => ), NextPage: forwardRef((props, ref) => ), PreviousPage: forwardRef((props, ref) => (  )), ResetSearch: forwardRef((props, ref) => ), Search: forwardRef((props, ref) => ), SortArrow: forwardRef((props, ref) => (  )), ThirdStateCheck: forwardRef((props, ref) => (  )), ViewColumn: forwardRef((props, ref) => ), }; const [status, setStatus] = useState("pending"); const [badge, setBadge] = useState("danger"); const handleClick = (e) => { //Do something if checkbox is clicked if (e.target.checked) { setStatus("paid"); setBadge("success"); } else { setStatus("pending"); setBadge("danger"); } }; // Table to be rendered in the modal function renderTable() { return (    Dues Amount Status     
Level 100 100 {status} handleClick(e)} />
Level 200 100 {status} handleClick(e)} />
Level 300 100 {status} handleClick(e)} />
Level 400 100 {status} handleClick(e)} />
); } return ( {/* Modal popup */} {id} {renderTable()} openModal(rowData)} /> ); }; export default Admin;
submitted by SnooJokes7475 to learnjavascript [link] [comments]


2021.12.09 10:53 that_doodleguy Will the crush say yes? [OC]

Will the crush say yes? [OC] submitted by that_doodleguy to wholesomememes [link] [comments]


2021.12.09 10:53 The-Hollow-Guy Day 1 of attempting to draw Silksong characters with a pencil


https://preview.redd.it/nblyt5ybvi481.jpg?width=3024&format=pjpg&auto=webp&s=eaa749f640c7a9775c428a6d6c56d0f96bf86994
submitted by The-Hollow-Guy to HollowKnight [link] [comments]


2021.12.09 10:52 Metallica_Is_Bae Damn, I think I was practicing guitar at school and one of those songs was The Unforgiven lol

Damn, I think I was practicing guitar at school and one of those songs was The Unforgiven lol submitted by Metallica_Is_Bae to Metallica [link] [comments]


2021.12.09 10:52 Bitball Important Announcement‼️ Unfortunately a large amount of #Ballswap #BSP & other #Crypto has been hacked from #Bitmart exchange. We are working with Bitmart team to come up with solutions regarding this situation. Trading has been suspended on Bitmart exchange till further notice.

Important Announcement‼️
Unfortunately a large amount of #Ballswap #BSP & other #Crypto has been hacked from #Bitmart exchange.
We are working with Bitmart team to come up with solutions regarding this situation.
We have temporarily withdrawn liquidity from dexs & contacted various exchanges regarding this situation.
Trading has been suspended on Bitmart exchange till further notice.
https://support.bmx.fund/hc/en-us/articles/4412000429595-Suspension-on-the-BSP-trading-feature
Please bare with us during this difficult situation.
Bitmart announcement: https://twitter.com/bitmartexchange/status/1467350568481878016
Tweet: https://twitter.com/bitballswap/status/1467416427971842049?s=21
submitted by Bitball to BitBallEcosystem [link] [comments]


2021.12.09 10:52 Retouchess 10 SOL AIRDROP 💲 READ THE COMMENT BELOW👀👇!!!

10 SOL AIRDROP 💲 READ THE COMMENT BELOW👀👇!!! submitted by Retouchess to ShitcoinStreet [link] [comments]


2021.12.09 10:52 jael-jorge-gerson la no r/initial d

la no initial d submitted by jael-jorge-gerson to suddenlycaralho [link] [comments]


2021.12.09 10:52 Due-Department6048 CryptoRats Lounge 📊 Let the money rainfall begin 💸 Every Channel and Every Signal is Free Till December 31st 🧰

The best signal provider VIP's are gathered in to one place, and it's completely free till December 31st!🥳 Hard to believe? Try it yourself!📈📈📈
We are offering only carefully chosen and time proven groups, which includes: ALT Signals, FatPig, Binance Killers, Russian Insiders, CoinCoach and many more!
Our one of the premium groups weekly profits: 🔒THIS WEEK TOTAL CRYPTO PREMIUM’S SIGNALS PROFITS
◽️Monday 💰+55.404%✅ ◽️Tuesday 💰 +56.138%✅ ◽️Wednesday 💰+119.838%✅ ◽️Thursday 💰+0.000%🔹 ◽️Friday💰+117.718%✅
📊 Total Profit: 349.098%🔥
🔸Total number of trades: 14 🔹Total trades hit SL: 1 🎯Accuracy: 92.857%
👉This week has been a rollercoaster. We start good, then we almost hit 3 Stop Losses in a row and finally recovered and make good profits to finish the week the way we know😌💰
📊From 14 trades, 12 have touched at least the second take-profit (TP2), this shows the great work from our trading team🎯
✊New week is coming, so get ready😈
Join us now and let the profit rainfall begin!🌨💰💰
https://t.me/CryptoSignalsLeaked
submitted by Due-Department6048 to CryptoMoonShots [link] [comments]


2021.12.09 10:52 InsatiableAnApetite Stuck on mobile

stuck on the screen that says "hearthstone, battlegrounds and mercenaries" on mobile and cant click any of the options
submitted by InsatiableAnApetite to hearthstone [link] [comments]


2021.12.09 10:52 TheGame2526 Trents Mum into the HOF lol

submitted by TheGame2526 to AEWOfficial [link] [comments]


2021.12.09 10:52 mango4everdo 👜 TRENDY 👠 | Anonymous luxury shopping 🛍️ | 💎 Low mcap | No pump and dump | Redistribution and buyback

💎 $TRENDY, the token you can spend to buy original and certified Gucci, Balenciaga, Louis Vuitton bags and accessories, without having to convert the tokens into FIAT currency. All sent to your home or to any place you wish, completely anonymously.
🚀 TOKENOMICS 🚀
Redistribution: 2%
Buy-Back: 6%
Marketing: 3%
Total supply: 1 Trillon
Holders: 200 (You Are Early!!!)
Transparent and sincere devs!
🌍 CHANNELS 🌍
Website: Trendy.Finance
ECommerce: TrendyStore Open Beta
Reddit: TrendyToken
Join us on Telegram: @ TrendyToken
Instagram: Trendy.Finance
Twitter: TrendyToken
BSCScan: BSCScan
Dextools Chart: Dextools Chart
Marketing
❇️ Poocoin ads
❇️ Google ads
❇️ Facebook ads
❇️ Twitter marketing
❇️ Reddit marketing
❇️ Telegram marketing
❇️ CMS top 10
All product and company names are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
submitted by mango4everdo to cryptostreetbets [link] [comments]


2021.12.09 10:52 bogan6739 Oscars vs. Kopps

Oscars burgers taste similar to Burger King. Kopps is by far the best. IMHO
submitted by bogan6739 to wisconsin [link] [comments]


2021.12.09 10:52 PatMathews What is CBD and its benefits? How is CBD or Hemp oil made?

What is CBD and its benefits? How is CBD or Hemp oil made? submitted by PatMathews to ausents [link] [comments]


2021.12.09 10:52 lordvoldybuff Mika Häkkinen: “It’s a beautiful moment for Formula One"

submitted by lordvoldybuff to formula1 [link] [comments]


2021.12.09 10:52 AshamedPollution5660 What are you looking forward to doing again that you haven't been able to do, due to the pandemic?

submitted by AshamedPollution5660 to AskReddit [link] [comments]


2021.12.09 10:52 Joyffree Rockstar's Ball A Rockstar Romance Anthology ➱ Book Tour with Giveaway

Rockstar's Ball A Rockstar Romance Anthology ➱ Book Tour with Giveaway submitted by Joyffree to WonderfulWorldofWords [link] [comments]


2021.12.09 10:52 rintosa Unemployed for 2 years

This is more of a vent than anything, but with that being said I don’t even have the right to vent since I haven’t applied anywhere since graduating and I’ve just been mooching off of my parents living in their house.
I feel stuck and like I can’t act. I think about things a lot but I overwhelm myself before taking the first step. I’m fully aware of how much I’m paralyzing myself and crippling my progress due to fear of failure and not being perfect. I know that mindset is awful and beyond unhelpful but I’m still here.
Often I’m consumed by self loathing and shame because of this. I’ll eat a meal and with each bite I’ll be reminded that I don’t deserve it because I didn’t earn it, and that by putting food in my face I’m only perpetuating my burdensome existence.
I’m extremely alone and isolated, despite living with a big family who loves and cares about me. I just can’t communicate my vulnerability to them. I know I have no right to complain. I’m not being forced to work by circumstances.
I feel so much worse waking up each day knowing it will be the same loop of inaction and just having nothing to do. I’ve been in weekly therapy for most of the pandemic, and while I feel I know myself significantly better I’m still completely and utterly paralyzed. I hate this and hate how I know all of the obvious solutions and how I just can’t will myself to do anything.
submitted by rintosa to self [link] [comments]


2021.12.09 10:52 Accomplished-Oil5173 Все виды услуг с гарантией, оказываемых в сети стоматологических клиник Краснодара IMPLANT (лечение, брекеты, имплантация, отбеливание и др).

Все виды услуг с гарантией, оказываемых в сети стоматологических клиник Краснодара IMPLANT (лечение, брекеты, имплантация, отбеливание и др). https://implant-krd.ru/
submitted by Accomplished-Oil5173 to recREC [link] [comments]


2021.12.09 10:52 LOLZ3000 Books on quiet BPD

I think I may have quiet BPD. Everything clicked when I read the symptoms.
I was wondering if someone could recommend any good books on quiet BPD?
submitted by LOLZ3000 to BPDlite [link] [comments]


2021.12.09 10:52 osoriense Caravana encontra escolas no Rio Grande do Sul sem luz, salas interditadas e problemas estruturais

Caravana encontra escolas no Rio Grande do Sul sem luz, salas interditadas e problemas estruturais submitted by osoriense to brasilivre [link] [comments]


2021.12.09 10:52 Parking_Pea1872 **Venus Square Saturn in Natal Chart** what is it that Saturn wants me to learn here outside of self worth and with it also squaring my Jupiter how does this add to it’s effect?

**Venus Square Saturn in Natal Chart** what is it that Saturn wants me to learn here outside of self worth and with it also squaring my Jupiter how does this add to it’s effect? submitted by Parking_Pea1872 to astrologylovers [link] [comments]


2021.12.09 10:52 throwaway3569387340 Fox Square All-American Christmas Tree arson suspect free on no bail

Fox Square All-American Christmas Tree arson suspect free on no bail submitted by throwaway3569387340 to Conservative [link] [comments]


2021.12.09 10:52 Keplergamer Third pass test

Third pass test submitted by Keplergamer to stabbot [link] [comments]


2021.12.09 10:52 myPPhurtzz 𝐀𝐩𝐩𝐲𝐬𝐡𝐨𝐭 - 𝐅𝐑𝐄𝐄 Drinking Game App, Android and iOS

I want all of you to get introduced and enjoy with your friends the best 𝐅𝐑𝐄𝐄 drinking game! 🥳 Just started launching this app so if you have a minute, I would really like to share this idea with you. 𝐀𝐩𝐩𝐲𝐬𝐡𝐨𝐭 is a brand-new app that came to the market to perfectly elevate drinking games. It’s completely 𝐅𝐑𝐄𝐄 with a premium option and available for iPhone and Android. Never Have I Ever, Would You Rather, Roleplay, Music, Girls Night, Guys Night, HOT (for more seductive nights 😜) and more! Pick one or 𝐌𝐎𝐑𝐄 categories for 𝐘𝐎𝐔𝐑 game and enjoy 2000+ different dares. On 𝐀𝐩𝐩𝐲𝐬𝐡𝐨𝐭 you’re the BOSS! Trust me, if you enjoy this app HALF as much as the people who already played it, the only problem you’re going to have is that you didn’t start this 𝐅𝐑𝐄𝐄 App sooner! 𝐆𝐨 𝐭𝐨 𝐀𝐩𝐩 𝐒𝐭𝐨𝐫𝐞 𝐨𝐫 𝐏𝐥𝐚𝐲 𝐒𝐭𝐨𝐫𝐞 𝐭𝐡𝐫𝐨𝐮𝐠𝐡 𝐭𝐡𝐢𝐬 𝐥𝐢𝐧𝐤 𝐨𝐫 𝐬𝐞𝐚𝐫𝐜𝐡 𝐟𝐨𝐫 𝐮𝐬 𝐢𝐧 𝐭𝐡𝐞 𝐬𝐭𝐨𝐫𝐞𝐬, 𝐚𝐧𝐝 𝐜𝐫𝐞𝐚𝐭𝐞 𝐦𝐨𝐦𝐞𝐧𝐭𝐬 𝐰𝐢𝐭𝐡 𝐀𝐩𝐩𝐲𝐬𝐡𝐨𝐭: https://appyshot.com/#app 𝐋𝐄𝐓'𝐒 𝐆𝐎! 🥳
submitted by myPPhurtzz to DrinkingGames [link] [comments]


2021.12.09 10:52 banana_phone1979 New player on The Island

I'm currently on the Southern shores and would like to tame an argy or maybe a griffin. What is the best way to traverse the map without dying every 5 minutes? Should I follow the east shore north to a mountain, or go up through the center where the swamp and redwood biomes are? I have a lvl 40 spino, a trike, and two raptors. My pternodon can't carry all my stuff (5 gateways and two Dino doors). Any recommendations would be appreciated!
submitted by banana_phone1979 to ARK [link] [comments]


http://sushiislove.ru