Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

131
Views
Can you unselect checkbox via code from MUI DataCode?

I'm having a small delay when I delete things in my code, for some reason even if I delete it since is "checked" it doesn't disappear unless I uncheck/refresh so I wanted to know if it was possible to uncheck via code that way I can uncheck as soon as I delete the item

Here how it looks the delay: Video

Code:

// Relevant variables:

    const data = JSON.parse(window.localStorage.getItem("verpedidos"))

    let librosData = data[0].data
    let tempLibrosData = librosData;

    const [selectionModel, setSelectionModel] = useState([]);
    
    //DataGrid checkbox selection code
    
       checkboxSelection
       //Store Data from the row in another variable
       onSelectionModelChange = {(id) => {
       setSelectionModel(id);
       const selectedIDs = new Set(id);
       const selectedRowData = librosData.filter((row) =>
       selectedIDs.has(row.id)
     );
    }
    
   //When delete is clicked

       onClick={() => {
       const selectedIDs = new Set(selectionModel);
       librosData.filter((x) =>
       selectedIDs.has(x.id)).map( x => {
       tempLibrosData = tempLibrosData.filter(e => e.id != x.id)

       //Override data with new values
       data[0].data = tempLibrosData
       window.localStorage.setItem("verpedidos", JSON.stringify(data));
      })
    }}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!