Grid with rowSpan crashes pagination

1 Answer 25 Views
Grid
smd
Top achievements
Rank 1
Iron
smd asked on 22 Feb 2024, 06:04 PM

Hi,

Is there a way to have both rowSpan and Pagination on a grid? 

My grid originally has pagination, now that I am trying to merge rows, which have the same values, within a column into a cell; other columns remain the same. I found that once I achieve that it displayed the grid briefly (enough to observed merged rows), but it crashed right away and report error on pagination. I can't remember the exact error but it has something to do with "process", "slice"...

Thank you for the support

Luu

 

1 Answer, 1 is accepted

Sort by
1
Accepted
Konstantin Dikov
Telerik team
answered on 25 Feb 2024, 05:19 PM

Hi Luu,

I have tested our rowSpan demo by enabling paging on it, but I was not able to observe any issues with the implementation:

If the issue on your side persists, please share an example reproducing the problem, so we can test and debug it locally.

Looking forward to your reply.

 

Regards,
Konstantin Dikov
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources!

smd
Top achievements
Rank 1
Iron
commented on 28 Feb 2024, 06:11 PM

Thank you Konstantin, I will look further into my codes to see where it goes wrong
smd
Top achievements
Rank 1
Iron
commented on 05 Mar 2024, 08:28 AM

Hi Telerik Support Team,

https://stackblitz.com/edit/react-yhhscl-qdhn6r?file=app%2Fmain.jsx

Please look at the above code with a minor modification - I moved the Discontinued column to another location, besides the last column.

You will notice the column is rendered incorrectly when you move to another pages. This is the issue I have been having. I hope you can help

 

Konstantin Dikov
Telerik team
commented on 05 Mar 2024, 09:30 AM

Hi,

Thank you for sharing an example demonstrating the issue.

The issue in question is due to the fact that the field added to the dataItems that determines the rowSpan of each cell is written for the case with no paging. In order to have the correct values for the row span you need to add that field only after the paging operation is applied, so that it can be handled per page. Here is the modified example that resolves the issue;

  const finalData = React.useMemo(() => {
    const processedData = process(gridData, dataState);

    const data = {
      data: mergeCells(processedData.data),
      total: processedData.total,
    };
    return data;
  }, [dataState, gridData]);
  return (
    <div>
      <Grid
        style={{
          height: '700px',
        }}
        data={finalData}

smd
Top achievements
Rank 1
Iron
commented on 05 Mar 2024, 01:52 PM

Thank you! Thank you! This is exactly where I have been stuck on
Tags
Grid
Asked by
smd
Top achievements
Rank 1
Iron
Answers by
Konstantin Dikov
Telerik team
Share this question
or