我在使用JSF數據表的JQuery時遇到問題。JQuery不適用於JSF動態UI組件
我有這樣的代碼:
<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;">
現在我的問題是,其有權申請DataTable中的CSS沒有得到應用。
我嘗試了不同的記號它仍然沒有工作 jQuery中我嘗試:
$ { '#searchform:例如'} $ { '#searchform.example'} 在這種情況下,對哈弗行動包含表本身將無法顯示數據表。
$ {「searchform#例如」} $ {「#例如」} 在這種情況下,懸停動作工程和數據表上渲染,但CSS是不適用
在這個任何人都可以幫助?
預先感謝 迪帕克
那是什麼''在jQuery選擇做什麼呢? – BalusC 2012-04-25 16:54:33
看看這個相關[回答](http://stackoverflow.com/questions/973496/cannot-pickup-id-with-jquery-for-the-jsf-textarea) – landal79 2012-04-25 16:57:51
只是一個格式化.. 。我只是試圖讓它大膽 – user1356720 2012-04-25 19:24:18