import { useEffect, useState } from "react"; import axios from "axios"; import { AgGridReact } from 'ag-grid-react'; import React from 'react'; import 'ag-grid-community/dist/styles/ag-grid.css'; import 'ag-grid-community/dist/styles/ag-theme-alpine.css'; function Read(props) { const \[record, setRecord\] = useState(''); useEffect(() => { axios.get('https://jsonplaceholder.typicode.com/comments') .then((response) =>{ console.log(response.data); setRecord(response.data); }) }, \[\]) function update(data){ console.log("hello"); } const col= \[ { headerName: "Name", field: "name"}, { headerName: "Email", field: "email"}, { headerName: "Body", field: "body"}, {headerName: "", headerClass: 'new-class', cellRendererFramework:(params)=> <div> <button onClick={() => update(params.data)}>Edit</button> </div>} \] return ( <> <div className="ag-theme-alpine" style={{height:'400px', width: '700px'}}> <AgGridReact columnDefs={col} rowData={record} pagination={true} > </AgGridReact> </div> </> ); } export default Read;
i am trying to get numbers in the pagination so if any one wants to go on a page they click on that page and they will get to that page but i can't find anything on google.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)