ID employeeDataTable を持つデータテーブルがあり、その中に以下のような列としてコマンドボタンがあります
<p:commandButton value="Me" update=":#{p:component('primaryEmployeeDetails')}" id="ajax"
actionListener="#{userPreferenceBean.saveEmployee}" styleClass="ui-priority-primary">
<f:param name="employeeName" value="#{employee.name}" />
</p:commandButton>
Jquery内のコマンドボタンを操作できるように、すべてのコマンドボタンを制御したいと考えています。これが私がやっていることです -
$(document).ready(function() {
$(".ui-priority-primary").click(function() {
//Getting all rows to iterate through them
var row = $(document.getElementById("myForm:employeeDataTable")).find("tbody:first").children("tr");
row.each(function() {
alert('inside row');
$(this).find('td').each(function(){
alert('inside each cell')
});
});
});
両方のアラートは正常に機能しています。しかし、2 番目のループですべてのコマンド ボタンの参照を取得する方法を教えてもらえますか? ありがとう。