Search code examples
javascriptliferayalloy-ui

Liferay set the id of liferay-ui:search-container-row


I want to set the id of the tr that is the result of the tag liferay-ui:search-container-row, how can I do it?

For Example, the resulting table row is:

<tr id="aui_3_4_0_1_350" class="portlet-section-header results-header">

I want to attach some javascript for the resulting table and I need something to refer to the various table row, like id="aui_3_4_0_1_350". I could also use the class selector, but I don't know how to set it.


Solution

  • It is not posible to set a customized id value to a search-container-row. Because they get generated based on the input list and Ids need to be unique. However you can access it using a selector starting with the search-container itself. It depends on what you are trying to accomplish.

    If you're using jQuery or similar it should be easy since there's a good variety of them: https://api.jquery.com/category/selectors/