Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

258
Visualizações
¿Cómo puedo configurar la verificación predeterminada en Ag-Grid React.js?

Uso reaccionar ag-grid y tengo checkboxSelection en la fila. Quiero marcar por defecto algunas filas, no marcar algunas filas. Cómo puedo hacer eso ?

 columnDefinationVoucherList: [ { headerName: "", cellRenderer: countCellIndex, width: 50, minWidth: 40, maxWidth: 50, editable: false, }, { headerName: "Belge Kodu", field: "ApplicationVoucher.Voucher.VoucherCode", width: 50, minWidth: 50, maxWidth: 80, suppressSizeToFit: true, sortable: true }, { headerName: "Belge Adı", field: "ApplicationVoucher.Voucher.VoucherName", width: 120, minWidth: 50, suppressSizeToFit: true }, { headerName: "Seç", field: "", width: 90, minWidth: 10, suppressSizeToFit: true, maxWidth: 50, checkboxSelection: true, }, ], <AgGridReact columnDefs={this.state.columnDefinationVoucherList} headerHeight={30} rowHeight={20} rowData={this.state.documentList} onColumnResized={true} enableCellChangeFlash={true} enableCellTextSelection={true} enableCellExpressions={true} enableSorting={true} enableFilter={true} enableGroupEdit={true} enableRangeHandle={true} defaultColDef={this.state.shortGridDefaultColDef} rowSelection={'multiple'} onSelectionChanged={this.GetSelectedVouchers} > </AgGridReact>

También uso el modo empresarial. Así que estoy abierto a todas las soluciones.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Resolví a favor de este sitio web https://blog.ag-grid.com/binding-boolean-values-to-checkboxes-in-ag-grid/

 import CheckboxRenderer from './CheckboxRenderer'; columnDefinationVoucherList: [ { headerName: "", cellRenderer: countCellIndex, width: 50, minWidth: 40, maxWidth: 50, editable: false, }, { headerName: "Belge Kodu", field: "ApplicationVoucher.Voucher.VoucherCode", width: 50, minWidth: 50, maxWidth: 80, suppressSizeToFit: true, sortable: true }, { headerName: "Belge Adı", field: "ApplicationVoucher.Voucher.VoucherName", width: 120, minWidth: 50, suppressSizeToFit: true }, { headerName: "Seç", field: "IsDocumentSelected", cellRenderer: "checkboxRenderer", width: 90, minWidth: 10, suppressSizeToFit: true, maxWidth: 50, editable: false }, ], <AgGridReact columnDefs={this.state.columnDefinationVoucherList} headerHeight={30} rowHeight={20} rowData={this.state.documentList} onColumnResized={true} enableCellChangeFlash={true} enableCellTextSelection={true} enableCellExpressions={true} enableSorting={true} enableFilter={true} enableGroupEdit={true} enableRangeHandle={true} defaultColDef={this.state.shortGridDefaultColDef} rowSelection={'multiple'} onSelectionChanged={this.GetSelectedVouchers} frameworkComponents={{ checkboxRenderer: CheckboxRenderer}} > </AgGridReact>

También agregué un nuevo archivo jsx e importé mi archivo js.

 import React, { Component } from "react"; export default class extends Component { constructor(props) { super(props); this.checkedHandler = this.checkedHandler.bind(this); } checkedHandler(e) { let checked = e.target.checked; let colId = this.props.column.colId; this.props.node.setDataValue(colId, checked); } render() { return ( <input type="checkbox" onClick={(e)=>{this.checkedHandler(e)}} checked={this.props.value} /> ); } }
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda