I am having a datatable with id employeeDataTable and inside that I have commandbuttons as column like below
<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>
I want to get the control of all commandbuttons so that I can do operation on those inside Jquery. This is what I am doing --
$(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')
});
});
});
Both alert's are working fine. But can you tell me how to get all commandbutton references in the second loop? Thanks.