Custom FlexGridFilter Values

Posted by: Alina.Gallahar on 27 December 2018, 1:22 pm EST

    • Post Options:
    • Link

    Posted 27 December 2018, 1:22 pm EST

    I have a FlexGrid with a column whose values are all hyperlinks. When I use the FlexGridFilter on this column, the filter editor also displays the column filter values as hyperlinks. When you click on a row’s text in the filter editor (to filter), the browser navigates to the hyperlink destination instead of checking/unchecking that value for filtering. The only way to filter is to actually check the checkbox, which is not always ideal for our use.

    Is there any way to manually modify the FlexGridFilter values to remove or disable the hyperlinks for the checkbox selection?

  • Posted 28 December 2018, 6:24 am EST

    Hi,

    If we understand correctly then in your application, isContentHtml property for the column is set to true(to display links).

    Now when filter editor is generated, it copies this property from the column and sets it to the ListBox control showing list of values which is causing the filter to show links rather than plain text.

    To avoid this we make take one of the following approaches:

    • set isContentHtml to false for the column and display links in the grid with the help of itemFormatter/formatItem.

    • handle filterChanging event and get the instance of ColumnFilterEditor and then set isContentHtml to false for the list box displaying filter values or handle its formatItem to format the links to normal text.

    Please refer to the following sample which demonstrates the same:

    https://stackblitz.com/edit/js-usrjrc?file=index.js

    ~Sharad

  • Posted 28 December 2018, 1:55 pm EST

    Awesome! That’s just what I was looking for. I went with the filterChanging option and it worked just as expected. Thanks!

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels