Add a CSS class to a generated html table element using search container.

Joao Vicente, modified 7 Years ago. New Member Posts: 14 Join Date: 10/1/14 Recent Posts

I've a search container that generates a  div with a table element inside.

 

<liferay-ui:search-container total="${totalTransactionsCount}" emptyResultsMessage="no-transactions-to-pay" curParam="transactionPage">
     <liferay-ui:search-container-results results="${totalTransactionsList}" />
     <liferay-ui:search-container-row className="foo.Transaction" modelVar="transaction">
      <liferay-ui:search-container-column-text cssClass="select">
       <aui:input cssClass="selectAllTransactions" id="checkAllTransactions" name="checkAllTransactions" label=""
        type="checkbox" checked="false"/>
      </liferay-ui:search-container-column-text>
      <liferay-ui:search-container-column-text cssClass ="text-nowrap" name="totalAmount" value="${transaction.totalAmount} &#8364;"/>
     </liferay-ui:search-container-row>
     <liferay-ui:search-iterator />
    </liferay-ui:search-container>
 

 

there is any way to add a css class to the table element? 

i've tried to use a JS function,  but on the onLoad step the table is still empty, it is only loaded in the end of all.

 

 

Thanks,


Joao

thumbnail
Minhchau Dang, modified 7 Years ago. Liferay Master Posts: 598 Join Date: 10/22/07 Recent Posts
Joao Vicente:

there is any way to add a css class to the table element?

Unfortunately, not until LPS-82855 (which adds a searchResultCssClass attribute to the liferay-ui:search-iterator tag), which won't be available until the next 7.1 GA release. If you need the functionality before that release, and you can't build Liferay from source yourself, you can try downloading a nightly 7.1.x snapshot from releases.liferay.com to see if everything works for you.

Joao Vicente, modified 7 Years ago. New Member Posts: 14 Join Date: 10/1/14 Recent Posts

Thank you for your clarification.
I'm using LR DXP, so I will try to find a workaround.



Best regards,


João Vicente

thumbnail
Minhchau Dang, modified 7 Years ago. Liferay Master Posts: 598 Join Date: 10/22/07 Recent Posts
Joao Vicente:
I'm using LR DXP, so I will try to find a workaround.

If you're using DXP 7.1, the change was released to subscribers as part of the DXP-2 fix pack.