Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 28th, 2012  |  syntax: None  |  size: 0.85 KB  |  hits: 25  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Changing background color of inputfield of editable coloumn in primefaces datatable on value change
  2. <p:column id="articleDescription" headerText="Article Description" filterBy="#{article.description}" filterMatchMode="startsWith">
  3.   <p:inputText id="description" value="#{article.description}"style="border:none; box-shadow:none;" />
  4. </p:column>
  5.        
  6. <p:inputText styleClass="changeable" />
  7.        
  8. $(document).delegate("tr :input.changeable", "change", function() {
  9.     var $this = $(this);
  10.     $this.css('background-color', $this.closest('tr').css('background-color'));
  11. });
  12.        
  13. .inputTextStyle {
  14.     background-color: transparent !important;
  15. }
  16.  
  17. <h:inputText id="vendorDiscountPerInputTxt"
  18.     value="#{articlePromo.descPromoPorcentaje}"
  19.     styleClass="inputTextStyle">
  20. </h:inputText>
  21.        
  22. $(document.getElementById(str)).css("background-color", "pink !important");