为什么我的大型JSF数据表不能仅在IE中填充? [英] Why is my large JSF data table is not populating only in IE?

查看:200
本文介绍了为什么我的大型JSF数据表不能仅在IE中填充?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用JSF中的HtmlDataTable来动态生成表。当我给出的行和列的数量大于25时,一些单元格不会在IE中被填充,并且变得非常慢。但是,当使用Firebug调试代码时,我可以看到值。它在Firefox和Chrome中正常工作。



这是怎么引起的,如何解决?

解决方案



通过引入懒惰加载和分页,使您的表格更小,没有其他解决方案,因此只会显示10〜100行立刻。如有必要,请添加搜索过滤器。额外的好处是它也更加用户友好。例如Google也不会在没有过滤和分页的情况下显示怪物表中的所有zillion网站链接。



如果您碰巧使用PrimeFaces,请使用 < p:dataTable> with LazyDataModel



另请参见:








根据评论更新,如果您无法更改服务器,则没有其他替代方法侧码。你最好的打赌可能是告诉最终用户,他/他应该使用真正的浏览器。



例如



< pre class =lang-js prettyprint-override> < script>
var ie = / * @ cc_on!@ * / false;

if(ie){
window.location ='some_page_which_recommends_different_browser.xhtml';
}
< / script>


I am trying to generate a table dynamically using HtmlDataTable in JSF. When I am giving the number of rows and columns greater than 25 each, some of the cells are not getting populated only in IE and it's getting very slow. However, I can see the value when debugging the code using Firebug. It is working fine in Firefox and Chrome.

How is this caused and how can I solve it?

解决方案

Internet Explorer is known to have an extremely poor table renderer. Especially when the columns and table nesting goes overzealous.

There's no other solution than making your table smaller by introducing lazy loading and pagination so that only 10~100 rows will be displayed at once. Add if necessary search filters. Additional benefit is that it's also much more user friendly. Google for example also doesn't show all the zillion website links in a monster table without filtering and pagination.

If you happen to use PrimeFaces, use <p:dataTable> with LazyDataModel.

See also:


Update as per the comments, there is not really other alternative if you can't change your server side code. Your best bet is probably to inform the enduser that s/he should be using a real browser instead.

E.g.

<script>
    var ie = /*@cc_on!@*/false;

    if (ie) {
        window.location = 'some_page_which_recommends_different_browser.xhtml';
    }
</script>

这篇关于为什么我的大型JSF数据表不能仅在IE中填充?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆