title: How to disable entire Primefaces dataTable
body: <p>Is there a way to disable the entire <code>dataTable</code> in Primefaces? Somebody suggested to use the <code>editable</code> component but that doesn't seem to help. </p>
  
  <blockquote>
    <p><code>#{conversionRatesBean.readOnlyUser}</code> is the code that filters out the group of users. </p>
  </blockquote>
  
  <p>I am using <strong>Primefaces 3.5</strong> and <strong>JSF 2.1.6</strong></p>
  
  <p>If not in Primefaces, can somebody suggest some solutions in jQuery?</p>
  
  <pre><code>&lt;div class="grid_12 width_75_pc margin_left_auto" &gt; 
      &lt;div class="datatable"&gt;
          &lt;p:dataTable editable="#{!conversionRatesBean.readOnlyUser}" id="conversionRateTable" var="row" value="#{conversionRatesBean.rowNames}" rowIndexVar="rowIdx" styleClass="projectTable table-container"&gt;
              &lt;p:column headerText="" styleClass="#{rowIdx  == -1  ? 'itPanelGreen' : 'ui-widget-header'} textAlignCenter valign-middle width_20_pc column_name" &gt;
                              &lt;h:outputText value="1  #{row.name} =" /&gt;
              &lt;/p:column&gt;
              &lt;p:columns var="column" value="#{conversionRatesBean.colNames}" headerText="#{column.name}" columnIndexVar="colIdx"
                                      styleClass="#{rowIdx == colIdx ? 'itPanelGreen' : 'textAlignCenter'}"&gt;
                    &lt;input:decimalField beanValue="#{conversionRatesBean.conversionMap[row][column].conversionValue}"
                        errorMsg="#{msgs['errorInvalidValue']}"
                        rendered="#{rowIdx != colIdx}"
                        decimalFields="4"
                        errorDecimal="#{msgs['packaging.error.number.decimals']}"
                        styleClass="textAlignRight "
                        maxLength="9"/&gt;
              &lt;/p:columns&gt;
          &lt;/p:dataTable&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="actions grid_12 alpha"&gt;
          &lt;p:commandButton id="saveBtn" value="Save" update="conversionRateTable"
              action="#{conversionRatesBean.save}"
              oncomplete = "qt.removeSavedState();"
              disabled="#{conversionRatesBean.readOnlyUser}"
              styleClass="js-saveButton button" onstart="screenUtils.triggerRequired(); if(screenUtils.errorsOnPage()){return false;}"/&gt;
  
          &lt;pretty:link mappingId="rateSelection" styleClass="displayInlineBlock margin_top_5"&gt;
              &lt;f:param value="#{conversionRatesBean.rateId}" /&gt;
              &lt;h:outputText value="#{msgs.backtoOverView}" styleClass="linky margin_left_10" /&gt;
          &lt;/pretty:link&gt;
  &lt;/div&gt;
  </code></pre>