Adding Html tag into the title of the Tree query in Oracle APEX

拥有回忆 提交于 2020-01-15 12:50:13

问题


I have a requirement to make few text in the title of my tree query in Oracle APEX to bold by adding b tag. But when i do that, the tag is displayed at the front end. My query is as mentioned below. I do not want to see the b tag, rather i want the text enclosed by b tag to be bold. Please help.

    SELECT
                        CASE
                                WHEN CONNECT_BY_ISLEAF = 1 THEN 0
                                WHEN level = 1             THEN 1
                                ELSE -1
                        END
            AS status,
            level,
                        CASE
                                WHEN level = 1  THEN questions
                                ELSE '<b>'  -- Comes in the front end which i do not want
                                || flow_condition
                                || '</b>'
                                || ' - '
                                || questions
                        END
            AS title,
            NULL AS icon,
            question_id AS value,
            NULL AS tooltip,
        --null as link
            apex_page.get_url(
                        p_page          => 401,
                        p_items         => 'P401_QUESTION_ID',
                        p_values        => question_id,
                        p_clear_cache   => 401
            ) AS link
    FROM
            (
                        SELECT
                                mmq.*,
                                mmm.flow_condition
                        FROM
                                msd_mc_questions mmq
                                LEFT OUTER JOIN msd_mc_par_chld_mapping mmm ON (
                                                    mmq.parent_id = mmm.parent_question_id
                                            AND
                                                    mmq.question_id = mmm.child_question_id
                                )
            )
    START WITH
            parent_id IS NULL
    CONNECT BY
            PRIOR question_id = parent_id
    ORDER SIBLINGS BY questions

回答1:


Struggled with this for hours but then found a solution via jQuery. Create a dynamic action that on page load and executes javascript. Find all items with class .a-TreeView-label (assuming that's the class name at runtime that you get as well - check to be sure) and loop over them and for each one, replace its text with itself. This forces it to re-render as HTML. My code in the javascript task:

$(".a-TreeView-label").each(function(index){
  $(this).replaceWith($(this).text());
});



回答2:


On the item attribute "Escape special characters" change to "No"



来源:https://stackoverflow.com/questions/46176845/adding-html-tag-into-the-title-of-the-tree-query-in-oracle-apex

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!