Is there any way to scroll DataTable with virtual scroll to any specific row?
I need to allow users to navigate to the table's page with row id as URL parameter and I need to scroll data table to the specified row.
Scroll table to the specific row
You can use lazy load and virtual scroll with first attribute to the specified row. Like;
Also you can read documentation for lazy or first (http://primefaces.org/primereact/#/datatable)
Code: Select all
<DataTable header="VirtualScroll with Lazy Loading" value={this.state.lazyCars} first={100} scrollable={true} scrollHeight="200px" virtualScroll={true}
rows={10} totalRecords={this.state.lazyTotalRecords} lazy={true} onLazyLoad={this.loadCarsLazy} style={{marginTop:'30px'}}>
<Column field="vin" header="Vin" />
<Column field="year" header="Year" />
<Column field="brand" header="Brand" />
<Column field="color" header="Color" />
</DataTable>
-
- Information
-
Who is online
Users browsing this forum: No registered users and 18 guests