【发布时间】:2012-04-25 16:37:37
【问题描述】:
在 JSF 数据表上应用 JQuery 时遇到问题。
我的代码是这样的:
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('<b>#example</b>').dataTable( {
"aoColumns": [
{ "asSorting": [ "asc" ] },
{ "asSorting": [ "asc" ] },
{ "asSorting": [ "desc", "asc", "asc" ] },
{ "asSorting": [ "desc" ] },
{ "asSorting": [ "asc" ] },
{ "asSorting": [ "asc" ] }
]
} );
} );
</script>
XHTML
<h:dataTable id="example" name="example" value="#{notificationBean.notificationList}" var="item"
cellpadding="0" cellspacing="0" border="0"
styleClass="display"
rowClasses="gradeC"
style="background-image: url('../images/ClientCare_Menu_Gradient.jpg'); background-repeat: repeat-x;">
渲染时:
<table id="searchform:example" class="display" cellspacing="0" cellpadding="0" border="0" style="background-image: url('../images/ClientCare_Menu_Gradient.jpg'); background-repeat: repeat-x;">
现在我的问题是必须申请数据表的 CSS 没有得到应用。
我尝试了不同的符号仍然没有用 在 Jquery 我试过:
${'#searchform:example'}, ${'#searchform.example'} 在这些情况下,包含表本身的悬停操作将无法显示数据表。
${'searchform#example'}, ${'#example'} 在这些情况下,悬停动作有效且数据表已呈现,但 CSS 未应用
有人可以帮忙吗??
提前致谢 迪帕克
【问题讨论】:
-
<b></b>在 jQuery 选择器中做了什么? -
看看这个相关的answer
-
只是一种格式...我只是试图让它变得粗体