Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

432
Vistas
Why Ag-grid display '?' (question mark) in pagination while Using Server Side rendering?

I am using React Ag grid Server Side Pagination. Data is loading corrrectly but sometime it display '?' marks in pagination.

enter image description here

However, it display correctly If I click next. enter image description here

Here is the code :

gridApi?.setServerSideDatasource({
      getRows: (params: IServerSideGetRowsParams) => {
        const { startRow, endRow, sortModel, filterModel } = params.request;
          refetch({
            result: 'ProjectSummary',
            startRow,
            endRow,
            tab: state.tab,
            filtergroup: JSON.stringify(filterModel),
            sortModel: JSON.stringify(sortModel?.length ? sortModel[0] : {}),
          }).then((response) => {
            if (response?.data) {
              const { datarows, total } = JSON.parse(response?.data?.body);
              if (response?.data?.statusCode === '200') {
                params?.success({
                  rowData: datarows,
                  rowCount: total,
                });
              }
            } else {
              params?.fail();
            }
          });
      }
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

As of now, I did not found any direct way to fix this but have a small hack. Here is the solution.

Define this function:

const setLbLastRowOnPage = () => {
    if (!gridApi) {
      return;
    }
    const lbLastRowOnPageEl = document.querySelector(`[ref=\'lbLastRowOnPage\']`);
    const isLastPage = gridApi.paginationGetTotalPages() === gridApi.paginationGetCurrentPage() + 1;
    const endRow = isLastPage
      ? gridApi.paginationGetRowCount()
      : (gridApi.paginationGetCurrentPage() + 1) * gridApi.paginationGetPageSize();
    if (lbLastRowOnPageEl) {
      lbLastRowOnPageEl.innerHTML = endRow.toString();
    }
  };

Now, call this in useEffect

useEffect(() => {
    setLbLastRowOnPage();
  }, [loading, gridApi]);
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda