Datatable set first value

UI Components for React
Post Reply
JimmyHL
Posts: 2
Joined: 09 Apr 2021, 14:36

09 Apr 2021, 14:42

Hey there,
I hope for a little help.

I would like to trigger the first value and set it from another component.
Case:
I select a Geometry in a map which holds the id of a corresponding value in the table.
Find the index and what to set the value first so it re render and show me the selected value in the table.

So far i have only had success with using the setstate inside the render, but i gives me an error in the console that i dont want.

JimmyHL
Posts: 2
Joined: 09 Apr 2021, 14:36

13 Apr 2021, 08:34

No response?

Do you need moreinformation pls tell me.

mert.sincan
Posts: 4710
Joined: 29 Jun 2013, 12:38

07 May 2021, 00:08

Hi,

Sorry for the delayed response! Could you please create a codesandbox link for us?

Maybe,
...
if (selected_Item) {
setFirst(<Selected_Item_Index> / rows) * rows);
}
..
<DataTable first={first} onPage={(e) => setFirst(e.first)} ... />

Best Regards,

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest