Dynamic Portlet click to select the style and portlet Style
1. Background
In the process of configuring the help information of the company's cloud platform, because the data URL of the dynamic portlet used obtains static data, there is no way to make the selected logic judgment in the background, therefore, you need to control the style of the selected list on the foreground. Here we will introduce how to change the style of the selected list on the foreground.
2 intended readers
Internal staff of shutong changlian
IT Industry enthusiasts
3. Glossary
- Full-dynamic Portlet: displays the preset display Portlet that allows you to control the display style by using a template.
- Static Data: Use a template to define the simulated data.
4. Implementation
Add the selected css to the dynamic display template and define the id attributes for the li and a tags. The frontend callback function sets the selected style for the current li tag by comparing the IDS.
5 implementation steps
Because the hyperlink of tag a in the list is used to refresh the page (href redirects to the current page, so refresh the page) at the same time, add parameters to the Address url so that the information body portlet on the right can obtain the parameter value. Therefore, you can use the callback function to obtain the parameter value in the url.