Тёмный

All Select Checkbox in React JS - In Hindi 

CodingWithJeevan
Подписаться 2,2 тыс.
Просмотров 62 тыс.
50% 1

In this video, I'll be explaining the concept of handling a single #checkbox and all select checkboxes in #React.
code sandbox: codesandbox.io/s/selectallche...
/* External Links */
//_book
books you should read: amzn.to/3gyGNqn
//_electronics
Coder's mouse: amzn.to/3EWdnfu
Coder's Keyboard: amzn.to/3V1nRjf
Laptop: amzn.to/3GFdEEA
Headphones: amzn.to/3XqDulT
By: Jeevan Kumar | g1mishra

Опубликовано:

 

25 июн 2021

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 96   
@sachinaugustine9023
@sachinaugustine9023 2 года назад
Love this mahn .... I literally spent an hour trying to figure out, then I came across this
@thegibiofficial
@thegibiofficial 2 года назад
Great video tutorial brow, Thank you so much!
@29void71
@29void71 9 месяцев назад
Great video! Explained well and to the point!
@LyDaiPhatB
@LyDaiPhatB 10 месяцев назад
easy to follow step by step, thank you so much
@vrdevendra
@vrdevendra Год назад
Thanks man, really very helpful👍
@monikabhardwaj9105
@monikabhardwaj9105 2 года назад
Thanks a lot. It was helpful
@tilakjha2496
@tilakjha2496 Год назад
Awesome man, thanks 👍
@developer4613
@developer4613 2 года назад
Thanks a lot bro. This video is really helpful.🙏🏻🙏🏻🙏🏻
@codingwithjeevan
@codingwithjeevan 2 года назад
Glad it helped
@rohitchaudhari3589
@rohitchaudhari3589 2 года назад
real time project work required this type of video sir
@sonlequang5843
@sonlequang5843 2 года назад
thanks ! You are great.
@raphaelmesquita4483
@raphaelmesquita4483 2 года назад
thank you soo much from Brazil :D
@abrarahamd9615
@abrarahamd9615 10 месяцев назад
Thank you sir this topic is helped me alots😍😍😍😍😍😍😍
@Mxbrpcnthdksk
@Mxbrpcnthdksk Год назад
Hello. Thank you very much for your efforts. For an input that has name="allSelect", instead of "checked={!users.some((user) => user?.isChecked !== true)}" you can write "checked={users.every((user) => user?.isChecked)}"
@Kamal_185
@Kamal_185 Год назад
very easy and smooth bro ... Thanks
@codingwithjeevan
@codingwithjeevan Год назад
Welcome 👍
@ishaqrabbu2970
@ishaqrabbu2970 Год назад
Thank you so much.
@shashankyadav866
@shashankyadav866 Год назад
realy helped❣thanks
@codingwithjeevan
@codingwithjeevan Год назад
Glad it helped!
@__chaudharysaab__
@__chaudharysaab__ Год назад
Bhai very helpful. Thanks. Laga koi dost baith ke smjha rha hai
@codingwithjeevan
@codingwithjeevan Год назад
Thanks ❤️
@ramiroalves2795
@ramiroalves2795 2 года назад
Muito top, me salvou e ganhou um inscrito.
@VivekKumar-jd6tc
@VivekKumar-jd6tc 2 года назад
Brother ..how can I do same thing when I am pressing Y button in keyboard for to sellect all and N button to deslect all
@mainakmukhrjee6328
@mainakmukhrjee6328 7 месяцев назад
thanks sir!
@sonnix31
@sonnix31 2 года назад
Well done. Is there a way to implement this functionality without the selectAll checkbox? E.g I want to be able to detect when all checkboxes are checked to apply a filter. Thanks
@codingwithjeevan
@codingwithjeevan 2 года назад
Yes, you can add a useEffect; having checkbox state as dependencies. And add you condition and function call based on requirement.. I hope it may make sense... Let me know if you have any queries..
@jyotighali8009
@jyotighali8009 Год назад
hi I want to know on button click how to get the checked names or values
@mithunkumarjha5201
@mithunkumarjha5201 2 года назад
Thanks
@bionicle0_o440
@bionicle0_o440 Год назад
Если бы не индусы с ютуба, я был бы безработный. Спасибо тебе добрый человек ^_^
@n7pankake236
@n7pankake236 2 года назад
This helped me a lot, have you consider doing one from the Material UI one ?
@zarefgamz2515
@zarefgamz2515 2 года назад
did you figured it out yet ?
@n7pankake236
@n7pankake236 2 года назад
@@zarefgamz2515 yeah
@zarefgamz2515
@zarefgamz2515 2 года назад
@@n7pankake236 plz show I've been working on it for hours
@n7pankake236
@n7pankake236 2 года назад
@@zarefgamz2515 Is a bit complicated it I would need to do a clean example for it I can just copy and paste the code I have if you want and you figure out how it works
@shahjalal502
@shahjalal502 2 года назад
thanks.
@RishavKumar-qq3mp
@RishavKumar-qq3mp Год назад
hello bro, how we do this in its select and options , how we get the the all selected value " .... "
@jaikrishna3586
@jaikrishna3586 Год назад
thanks bro
@codingwithjeevan
@codingwithjeevan Год назад
Welcome 🤗
@abhijeetshikharvlog1444
@abhijeetshikharvlog1444 2 года назад
Hi i need one help from ur end for this topic
@rohitchaudhari3589
@rohitchaudhari3589 2 года назад
nice one video
@codingwithjeevan
@codingwithjeevan 2 года назад
Thanks 😊
@codingcage5906
@codingcage5906 Год назад
Hello brother thank you very for this amazing video , What if there nested check boxes, As currently I am trying to implement nested checkboxes but stuck at some point, can you please help me out !?
@codingwithjeevan
@codingwithjeevan Год назад
Please share codesandbox link.. I'll check
@codingcage5906
@codingcage5906 Год назад
@@codingwithjeevan thank you sharing
@ayaancoding
@ayaancoding Год назад
hi, incase of defaultChecked, onChange event is not working..can you plz give working example of defaultChecked checkbox list from api with onChange event.....also plz make a video of dynamically populated table with defaultValue and onChange event of select box in table row
@codingwithjeevan
@codingwithjeevan Год назад
Okay will try to make a video on this. If you need some instant help, you can ping me on instagram or Linkedin.
@bhojakrahul5880
@bhojakrahul5880 3 года назад
Hey can you help me bro i have checkbox in my table there are 10 records in my table so i have total 11 checkbox (1) is main for "Thead" and (10) for [tr td] so how I get checkbox value of row checkbox
@codingwithjeevan
@codingwithjeevan 3 года назад
Yes, sure. Ping me on instagram : g1_mishra
@abhinavswami4696
@abhinavswami4696 2 года назад
Did you get your ans.?
@codingwithjeevan
@codingwithjeevan 2 года назад
@@abhinavswami4696 codesandbox.io/s/relaxed-thompson-984zg
@abhijeetshikharvlog1444
@abhijeetshikharvlog1444 Год назад
Codesandbox not working please update
@simranpathan2853
@simranpathan2853 2 года назад
Hey.i need guidence in reactjs .i stuck in checkbox Checkbox is not get checked can u please me in that
@codingwithjeevan
@codingwithjeevan 2 года назад
How can I help you?
@smratpushpendra1011
@smratpushpendra1011 3 года назад
hey ! please help me same ye work muje bhi krna hai but muje input field me krna hai kyoki meri value wha pr nhi aa rhai hai isliye
@codingwithjeevan
@codingwithjeevan 3 года назад
Smjha nhi, can you explain.
@jainagda7419
@jainagda7419 2 года назад
hello bhaiya please ek help chahiya the problem is ....if mera pass ek vedio library hai and i map that and i have one button add video ..... that button will open the video library after that i want to select the video and after selecting i will click,done button and after that all the selected video will be share in another component as well how can i do this please help me for that because i have to submit this feature on wed please bhaiya
@codingwithjeevan
@codingwithjeevan 2 года назад
Bro ping me on instagram. g1_mishra
@navinrangar2626
@navinrangar2626 Год назад
how can we set 'isChecked' key value, if it doesn't exist on the object. good video but couldn't work this part
@codingwithjeevan
@codingwithjeevan Год назад
share codesandbox link of your implementation.
@shivbore6620
@shivbore6620 Месяц назад
Instead of filter you can use array every method
@codingwithjeevan
@codingwithjeevan Месяц назад
Yes, you're right. In codesandbox link you can see, I have used some. It depends what comes to mind at that particular moment.
@archarajan4716
@archarajan4716 2 года назад
Can we put this inside a dropdown list?
@codingwithjeevan
@codingwithjeevan 2 года назад
Yes
@didemkahyaoglu946
@didemkahyaoglu946 Год назад
I did all the steps in the video one by one, but All Select didn't work for me. I'm getting the "support for the experimental syntax 'optional chaining' isn't currently enabled" error. For "user?.isChecked || false " expression I have tried "checked = user!==null ? user.isChecked : false" but it didn't work. I am glad if you help
@codingwithjeevan
@codingwithjeevan Год назад
Share your codesandbox link
@didemkahyaoglu946
@didemkahyaoglu946 Год назад
@@codingwithjeevan I think youtube is constantly deleting my comment because there is a link, so I'm pasting the code here. import React, { useState, useEffect } from 'react'; const UserTable = props => { const [users, setUsers] = useState([]); const userData = [props.users]; useEffect(() => { setUsers(userData) }, []); const handleChange = (e) => { const { name, checked } = e.target; if (name === "allSelect") { let tempUser = users.map(user => { return { ...user, isChecked: checked } }); setUsers(tempUser); } else { let tempUser = users.map(user => user.name === name ? { ...user, isChecked: checked } : users); setUsers(tempUser); } } return ( Select All Hostname Username Stop Sleep Start Status CPU Temperature(°C) GPU Info Edit/Delete { props.users.length > 0 ? ( props.users.map(user => ( {user.name} {user.username} props.editStopPC(user)} className="btn btn-danger">Stop props.editSleepPC(user)} className="btn btn-warning">Sleep props.editStartPC(user)} className="btn btn-success">Start {user.status} {user.cpu} {user.info} props.editRow(user)}> edit props.deleteUser(user.id)}> delete )) ) : ( {props.users[0]} No Users ) } ) }; export default UserTable;
@navinrangar2626
@navinrangar2626 Год назад
same thing with me
@pranithaa9706
@pranithaa9706 2 года назад
Can you give me an idea how to add default checked option in this
@codingwithjeevan
@codingwithjeevan 2 года назад
Yes. You can pass isChecked : true to the object which you wanted to be default selected.
@pranithaa9706
@pranithaa9706 2 года назад
@@codingwithjeevan but I can't change the API is there any chance to do with if else if
@codingwithjeevan
@codingwithjeevan 2 года назад
You can prepare data after getting response from API and then set that data into state.
@pranithaa9706
@pranithaa9706 2 года назад
@@codingwithjeevan yaa i will try it thanks
@pranithaa9706
@pranithaa9706 2 года назад
@@codingwithjeevan hey thanks dude i got it
@carloscesarvalle4678
@carloscesarvalle4678 2 года назад
user?.isChecked doesn't work for class components?
@codingwithjeevan
@codingwithjeevan 2 года назад
It will work
@carloscesarvalle4678
@carloscesarvalle4678 2 года назад
@@codingwithjeevan it says reactjs needs something else to read that logic :/
@foodieguy3140
@foodieguy3140 10 месяцев назад
Instead of array.filter() for allSelect checked, you could have used array.every()
@codingwithjeevan
@codingwithjeevan 10 месяцев назад
Agree but It's better to use array.some() in this case. It was updated way back in the source code.
@billyjesscastillo8025
@billyjesscastillo8025 Год назад
Greetings, Sir! I hope you can add a delete button that can handle more than one data upon deleting. I hope you can notice my comment, Sir. Thank you!
@jafarkhan-zg6le
@jafarkhan-zg6le 2 года назад
voice encreess
@armaanmidha8095
@armaanmidha8095 Год назад
Module parse failed: Unexpected token (332:18) You may need an appropriate loader to handle this file type. | name: "allSelect", | checked: data.filter(function (user) { > return user?.isChecked !== true; | }).length < 1, | onChange: handleCheckbox, getting this error
@codingwithjeevan
@codingwithjeevan Год назад
Remove those optional chaining. stackoverflow.com/questions/61440200/optional-chaining-does-not-work-in-create-react-app
@zahidkhubaib
@zahidkhubaib Год назад
when we select name after un-check value not remove in state
@codingwithjeevan
@codingwithjeevan Год назад
not possible... have you checked codesandbox link given below?
@codingwithjeevan
@codingwithjeevan Год назад
try to add the this line: `console.log(...users.filter(i => i?.isChecked));` if it's still not clear, let me know
@sram8667
@sram8667 2 года назад
how to add this inside a dropdown
@codingwithjeevan
@codingwithjeevan 2 года назад
Create your custom dropdown and add checkbox in the same way
@codingwithjeevan
@codingwithjeevan 2 года назад
I have made a example customize it as much as you can codesandbox.io/s/customdropdown-602uy?file=/src/App.js
@codingwithjeevan
@codingwithjeevan 2 года назад
Hit that RED subscribe button. If I was able to help you in anyway :)
@southcomet
@southcomet 2 года назад
@@codingwithjeevan i used react select but some tweaking required
@major7055
@major7055 Год назад
this isnt a functional example. state wont get updated as expected. eg. when we click 2 checkboxes, state will only have one box checked
@codingwithjeevan
@codingwithjeevan Год назад
can you please explain the issue and step to re-produce? and have you checked code-sandox link
@MrAmrmnabil
@MrAmrmnabil 2 года назад
Would u translate to English??
@swapneshdalvi1893
@swapneshdalvi1893 Год назад
Thanks
@ArvindKumar-tc8vb
@ArvindKumar-tc8vb Год назад
Thanks
@ankitkumarsharma2372
@ankitkumarsharma2372 Год назад
Thanks
Далее
Delete Multiple records Using Checkbox in React js
25:55
Good dad 🥰 #demariki
00:17
Просмотров 9 млн
React Hooks Course - All React Hooks Explained
1:26:21
6 State Mistakes Every Junior React Developer Makes
15:53