在IE8和IE9兼容模式下,可滚动Div只滚动结构,而不能滚动Primefaces数据的数据 [英] Scrollable Div only scrolls structure but not data of Primefaces datable in IE8 and IE9 compatability mode
问题描述
div滚动表,但数据不会移动.它在IE9(非兼容模式)和Firefox中运行良好.下面是一个简单的示例.有人知道解决方法吗?
The div scrolls the table, but the data doesn't move. It works fine in IE9 (non-compatability mode) and Firefox. A simple example is below. Anyone know of a workaround for this?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title>Carousel Test</title>
</h:head>
<h:body>
<h:form id="evaluationForm">
<div style="overflow:auto; height:200px">
<p:dataTable value="#{evaluationBean.items}" var="item">
<p:column headerText="ID">
<h:outputText value="#{item.id}" />
</p:column>
</p:dataTable>
</div>
</h:form>
</h:body>
</html>
谢谢, 尼尔
推荐答案
只需关闭IE兼容方式
<h:head>
<f:facet name="first">
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
</f:facet>
...
</h:head>
请注意,<f:facet name="first">
特定于PrimeFaces.因此,如果您不使用它,只需将其删除并将<meta>
标记放在<h:head>
的最顶部,它也将很好地工作.关键是它必须在PrimeFaces生成的指向主题CSS的<link>
元素的 之前出现.另请参见 MSDN文档:
Note that the <f:facet name="first">
is specific to PrimeFaces. So if you're not using it, just remove it and put the <meta>
tag in the very top of the <h:head>
, it'll work as good as well. The key point is that it has to appear before the PrimeFaces-generated <link>
element pointing to the theme CSS. See also the MSDN document:
与X-UA兼容的标头不区分大小写;但是,它必须出现在网页标题("HEAD"部分)之前,除
title
元素和其他meta
元素之外的所有其他元素之前.
The X-UA-Compatible header isn't case sensitive; however, it must appear in the header of the webpage (the HEAD section) before all other elements except for the
title
element and othermeta
elements.
因此,这意味着它在出现在<link>
元素之后时将不起作用.
Which thus means that it won't work when appearing after for example a <link>
element.
这篇关于在IE8和IE9兼容模式下,可滚动Div只滚动结构,而不能滚动Primefaces数据的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!