在 APEX Oracle 中的 LOV 中使用 html 表达式

问题描述 投票:0回答:1

我正在使用 APEX ORACLE 版本 23.1。 在交互式网格中,我有一列用于选择值并将其保存在数据库中。我将该列设置为键入 Popup LOV。 LOV 的来源是一个 SQL 查询,它使用 html 代码以预定义样式显示和返回值。

我使用了以下查询

select
'<span class="class1">' || value || '</span>' as col1 
-- which will be used for displaying in drop-down list and returning after selecting
-- each value has different text color and different text font
from table1

但是,运行应用程序时,使用此 LOV 的列显示纯文本,而不是“格式化”文本。

是否可以将此列中的这些值作为“格式化”文本?

预先感谢您的帮助。

html oracle oracle-apex apex
1个回答
0
投票

如果每次更新/渲染此列时都可以使用 Javascript/JQuery 片段,则可以为该列提供类名并使用:

$('.your_class').html($('.your_class').text());

这将获取单元格的原始值并将其作为 HTML 附加。

© www.soinside.com 2019 - 2024. All rights reserved.