I\'m working with JSF 2.1.6 and Primefaces 3.4.1 and I have a question.
I have an editable datatable with row editor. You can click the pencil button of each row, an
You need to iterate through the elements, and cancel any other edit.
$('.myTableStyle tbody.ui-datatable-data tr td span.ui-row-editor span.ui-icon-cancel').each(function(){
$(this).click();
});
The above solution is not working for me. As an alternativ solution, I just hide the edit-button (pencil) when I'm editing a row with css
<p:ajax event="rowEditInit" oncomplete="$('.ui-row-editor span.ui-icon-pencil').each(function(){$(this).css('visibility','hidden')});" />
<p:ajax event="rowEdit" oncomplete="$('.ui-row-editor span.ui-icon-pencil').each(function(){$(this).css('visibility','visible')});"/>
<p:ajax event="rowEditCancel" onstart="$('.ui-row-editor span.ui-icon-pencil').each(function(){$(this).css('visibility','visible')});"/>