How to make the move the checkbox to second column in case of MUI X DataGridPro tree view

0 votes
Can i know How to make the move the checkbox to second column in case of MUI X DataGridPro tree view?
1 day ago in Node-js by Ashutosh
• 24,410 points
11 views

1 answer to this question.

0 votes

You need to customize the column configuration to move the checkbox selection control to the second column in a MUI X DataGridPro tree view,

Here's how to do it:

Solution

import { DataGridPro } from '@mui/x-data-grid-pro';

const columns = [

  {

    field: '__check__',

    headerName: '', 

    width: 50,

  },

  {

    field: 'name',

    headerName: 'Name',

    width: 200,

  },

];


function TreeDataGrid() {

  return (

    <DataGridPro

      rows={rows}

      columns={columns}

      treeData

      getTreeDataPath={(row) => row.hierarchy}

      checkboxSelection

      disableSelectionOnClick

      initialState={{

        columns: {

          columnOrder: ['name', '__check__', /* other columns */], 

        },

      }}

    />

  );

}

answered 9 hours ago by anonymous

Related Questions In Node-js

0 votes
1 answer

How to get the _id of inserted document in Mongo database in NodeJS?

// ... collection.insert(objectToInsert, function(err, data){ if ...READ MORE

answered Apr 21, 2022 in Node-js by anonymous

edited Mar 5 14,053 views
0 votes
1 answer
0 votes
1 answer

How to customize Autocomplete of MUI, in react?

you can use the following approaches to ...READ MORE

answered 9 hours ago in Node-js by anonymous
16 views
0 votes
0 answers
0 votes
1 answer

How to select specific marker in MUI React Charts

You can implement marker selection through click ...READ MORE

answered 9 hours ago in Node-js by anonymous
11 views
0 votes
1 answer

What is the importance of crud operations?

CRUD (Create, Read, Update, Delete) operations are fundamental ...READ MORE

answered 9 hours ago in Node-js by anonymous
14 views
0 votes
1 answer

How can i fix the helvetica error in NextJS with pdfkit-Table

It typically occurs when PDFKit (used by ...READ MORE

answered 9 hours ago in Node-js by anonymous
11 views
0 votes
1 answer

How to customize Autocomplete of MUI, in react?

The following approaches are used to customize ...READ MORE

answered 9 hours ago in Node-js by anonymous
16 views
0 votes
1 answer

How do I control the space between the bars in my BarPlot of my MUI Bar Chart?

Controlling Space Between Bars in MUI Bar ...READ MORE

answered 9 hours ago in Node-js by anonymous
16 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP