Can livescroll be used for dynamic datatable?
Can livescroll be used for dynamic datatable? If so, how for instance would you refresh the datatable data when the existing info becomes stale? Seems as though with livescrolling on the js ajax callback always just appends to the end of the current table data.
Yesjsaliga wrote:Can livescroll be used for dynamic datatable?
Catch-22? The only basic way you yourself would know is to query all data again...jsaliga wrote:If so, how for instance would you refresh the datatable data when the existing info becomes stale
Second more complex option is to have some pub-sub mechanism where when updating a row from somewhere else, you get a notification and use that to do what? A full refresh and update the full table? Or try to update the individual row?
Correctjsaliga wrote:Seems as though with livescrolling on the js ajax callback always just appends to the end of the current table data.
I personally would just check with e.g. a version number if it is updated at the moment the record is actually opened
Thanks for the reply Ronald.
I'm still not clear on how I can force the livescroll datatable to dump all existing table data and essentially start from scratch with a new record set from a fresh db query. I'm hoping to avoid a complex solution for such a simple refresh.
Example:
Query the DB for a list of types of "Cats". I have livescroll="true" and scrollRows="15". The query returns 100 types of cats. If I requery using the same query. The original 100 cat types remains in the list and the exact same list is duplicated again.
Is the original query being cached or something?
I'm still not clear on how I can force the livescroll datatable to dump all existing table data and essentially start from scratch with a new record set from a fresh db query. I'm hoping to avoid a complex solution for such a simple refresh.
Example:
Query the DB for a list of types of "Cats". I have livescroll="true" and scrollRows="15". The query returns 100 types of cats. If I requery using the same query. The original 100 cat types remains in the list and the exact same list is duplicated again.
Is the original query being cached or something?
We're PrimeFaces elite subscribers on the almost latest 5.1.5 build. I'm not using any form of pagination. I simply have a list of objects that the backing bean provides via the get function. Everything works perfectly fine until I turn livescroll on. The reason why we want to use livescroll is because we need to support IE8 and a DB query could yield thousands of results. The client does not want pagination so unfortunately that's not an option.
I've scoured through the primefaces source code on github (https://github.com/primefaces/primefaces) in order to understand why the livescroll datatable ajax update of the dataset with the same dataset would result in duplication when scrolling yet when updating with a different dataset it does not, without success...
If anyone has any ideas on what might be going wrong please advise. I'm not doing anything complex here and I shouldn't have to change my solution to a complex one to avoid duplicating table rows when ajax sends back the same row data.
I've logged an issue in the meantime as I'm fairly confident that this is a bug unless someone can prove me wrong. https://code.google.com/p/primefaces/is ... il?id=7752
I've scoured through the primefaces source code on github (https://github.com/primefaces/primefaces) in order to understand why the livescroll datatable ajax update of the dataset with the same dataset would result in duplication when scrolling yet when updating with a different dataset it does not, without success...
If anyone has any ideas on what might be going wrong please advise. I'm not doing anything complex here and I shouldn't have to change my solution to a complex one to avoid duplicating table rows when ajax sends back the same row data.
I've logged an issue in the meantime as I'm fairly confident that this is a bug unless someone can prove me wrong. https://code.google.com/p/primefaces/is ... il?id=7752
-
- Information
-
Who is online
Users browsing this forum: No registered users and 36 guests