• Post Reply Bookmark Topic Watch Topic
  • New Topic

setting scroll position to a particular row of primefaces datatable  RSS feed

 
vinoth Robert
Ranch Hand
Posts: 32
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
    I have a data table with thousands of data. i have a search functionality. if I search a term, the row which contains the term has to be highlighted and scroll position should be on the row. it is working fine. but it takes too much of time to position the scrollbar. this leads to performance issue. can anyone help to fix this.

currently i have set style class to the match row. searching for the style class and calculating the position and setting it with jQuery.


is there any other way?
thanks in advance.
 
Tim Holloway
Bartender
Posts: 18662
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You really shouldn't attempt to display thousands of rows of data on a single web page. It's injurious to the eyes and sanity of the user. Plus, downloading all that data will give terrible performance, even if you scroll the display. It's far better to pre-filter the display to some reasonable size.

That's just general advice and not JSF-specific. One way to improve performance in JSF is to realize that the UI Model object (the DataTable) doesn't actually have to be an ORM Persistence Model object. It can just as easily be made from selected items instead of the entire query result. Or, for that matter, you can refine your query to return only items of immediate interest.

PrimeFaces can handle scrolling of DataModels without hard-coded JavaScript.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!