Forum Stats

  • 3,768,169 Users
  • 2,252,755 Discussions
  • 7,874,481 Comments

Discussions

Filtering a grid on a column with type html expression

TexasApexDeveloper
TexasApexDeveloper Member Posts: 7,812 Gold Crown
edited Dec 19, 2019 11:08AM in APEX Discussions

Using APEX 18.2, Database 12.1, I have a page with a read-only grid that has multiple columns of data.  One of these columns shows errors found in a process that built the data in the grid.  Now to get the format to what my customer wants I am displaying this column with a type of html expression. 

I have a need to allow the user to filter so they only see rows in the grid where this error column is not null.  However using a column with the html expression type does allow it to be filtered.  Is there a way around this issue?

Thank you!!

Tony Miller

Los Alamos, NM

Answers

  • TexasApexDeveloper
    TexasApexDeveloper Member Posts: 7,812 Gold Crown
    edited Dec 19, 2019 11:08AM

    Just boosting this up for help if anyone has a solution..

    Thank you,

    Tony Miller

    Los Alamos, NM

  • Toufiq - Hexagon PPM
    Toufiq - Hexagon PPM Member Posts: 17 Red Ribbon
    edited Feb 19, 2021 12:15PM

    HTML Expression column type does not allow for filtering.

    Here's how you can do it using cellTemplateOption

    You can use normal column types like "Display Only" and put your HTML formatting as cellTemplate attribute in JavaScript Initialization Code section of column (not grid)


    `function (options) {

      options.defaultGridColumnOptions = {

          cellTemplate: "<span class= 'predefined-css-classes &CSS_CLASS.'> &DATA_COLUMN.</span>"

        };

      return options;

    }`

    Here CSS_CLASS and DATA_COLUMN are columns in the grid source.


    The column DATA_COLUMN contains only data (the text that is visible to user). No HTML tags in the DATA_COLUMN column.

    Hope this helps. :-)


    Regards

    Toufiq