liferay-ui:search-container中的动态列? [英] Dynamic columns in liferay-ui:search-container?

查看:75
本文介绍了liferay-ui:search-container中的动态列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试过liferay-ui:search-container以表/网格格式在UI上获取并显示数据库表记录.通过使用liferay-ui:search-container,我得到如下所示的输出,

I have tried the liferay-ui:search-container to fetch and display the database table records on UI in a table/grid format. By using the liferay-ui:search-container I am getting the output as shown below,

我正在上面的屏幕快照中获取USER_表记录.

I am fetching the USER_ table records in the above screen shot.

问题:

我想使网格列动态化,我想为最终用户启用一个选项,以删除不需要的列并在相应的网格/表中添加所需的列.

I wanted to make the grid columns dynamic like, I wanted to enable an option for end user to remove the unwanted columns and add the wanted columns in the respective grid/table.

EX:

在上面的屏幕截图中,以下几列显示在一个网格中.

In the above screen shot the the following columns are showing in a grid.

First Name, Last Name, Screen Name, Job Title, Organization, User Groups

现在,如果用户要删除Job Title并希望在UI上添加具有点击事件的Greetings and Mail Address列,而无需触摸/修改代码.

Now If user wants to remove Job Title and wants to add Greetings and Mail Address columns on UI with click events with out touching/ modifying the code.

如何实现此功能?

注意:

我需要为自定义模型实现此功能.

I need to implement this feature for custom models.

查询:

1)是否有任何API/方法来实现/启用此功能?

1) Is there any api/methods to implement/enable this feature?

2)如果没有,我该如何执行这些步骤?有什么建议或步骤可以完成这项任务吗?

2) If not how can I do implement the steps? Any suggestions or steps to achieve this task?

推荐答案

这可以通过在Portlet中添加配置页面来实现.

This can be achieved by adding a configuration page to your portlet.

您可以开发portlet配置页面,其中可以配置必需的选项并将其另存为portlet首选项.

You can develop portlet configuration page which can have required options to be configured and save as portlet preferences.

稍后在显示搜索容器时,您可以检索portlet首选项并仅显示在配置表单中选择的那些列.

Later on while displaying the search container you can retrieve the portlet preferences and display only those columns which were selected in the configuration form.

此处是有关如何使用portlet首选项开发portlet配置的链接:

Here is a link on how to develop the portlet configuration using portlet preferences: Implementing Configurable Portlet Preferences

这篇关于liferay-ui:search-container中的动态列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆