那么你可以尝试不使用liveScroll,因为你不知道dataList的结束。试试这个,也许这适合你的需求。这将会延迟到你的dataTable的底部。
<h:form prependId="false">
<p:dataTable id="dataTable" var="c" value="#{MessagingUserBean.inboxDetails1}" scrollHeight="517" liveScroll="true" emptyMessage="No Message Found" scrollWidth="815" >
//Your dataTable stuff
</p:dataTable>
</h:form>
<script>
//Get the scrollheight
var s = jQuery('#dataTable .ui-datatable-scrollable-body').prop('scrollHeight');
//Get total size of datatable
var o = jQuery('#dataTable .ui-datatable-scrollable-body').prop('offsetHeight');
//calculate how many times it can scrolldown to set your timer
var t = Math.ceil(s/o);
//Excute scrolldown animation (max scrolldown is scrollHeight - offsetHeight)
$('#dataTable .ui-datatable-scrollable-body').animate({scrollTop:s-0}, t*1000);
</script>
会反向排序修复它吗? – kostja
不,我想做一个像facebook一样的消息功能。 – Rounak