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

423
Views
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 answers
Answer question

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 Report
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!