I need to pass the rowIndexVar of datatable to jquery.
Datatable:
<p:dataTable id="articlesInformation" var="article" value="#{articleBean.articleDataModel}"
selection="#{articleBean.selArticles}" rowIndexVar="rowIndex">
InputText:
<p:column id="articleDescription" headerText="Article Description">
<p:inputText id="inputTxt" name="inputTxt" value="#{article.description}" />
</p:column>
The id of this input text becomes : ‘articlesInformation:’ + rowIndex + ‘:inputTxt’;
Jquery :
$(document).ready(function(){
$('input[id$="inputTxt"]').change(function() {
$('input[id$="inputTxt"]').css("background-color","yellow");
});
});
This works pretty fine. Background color of all the the input texts is changed. I just need to change the background color of the input text which got changed. Need the value of rowIndex. How can it be accessed in jquery??
Thanks,
Shikha
you dont need the rowIndexVar to get the row id. you can get the row index on chaned/keypressed event etc..
inside the input