Author Topic: How to Filter the rendered column  (Read 271 times)

vijay@spinetechnologies

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 87
    • View Profile
How to Filter the rendered column
« on: February 21, 2023, 11:19:44 am »
Dear Paramvir,


I am facing an issue while filtering the data of a rendered column.

My column Model is as follows.
{
                title: "Is Default", dataType: "string", dataIndx: "IsDefault", editable: false,
                render: function (ui) {
                    var isdefault = ui.rowData.IsDefault;
                    if (isdefault == 1) {
                        return `<span>Yes</span>`;
                    }
                    else {
                        return `<span>No</span>`;
                    }
                }
            }

From my data object, I am getting a column with the Property of IsDefault.
 The values of the IsDefault column are in 0/1 Format and in rendering I am updating the text of the column as Yes/No.

The above code is perfectly working in the Display and export, but the filter not working.

Also, for the date column I am using the format prop of the column. While using the format prop. Display and Filter are working but in export data display as in the original format

Kindly provide a solution/ method for the above mention queries.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: How to Filter the rendered column
« Reply #1 on: February 21, 2023, 02:25:10 pm »
Are you using inbuilt header filtering or custom filtering.

Filtering is done by cell values and not by rendered cells, so if you are calling filter method, you have to filter by 1 or 0 instead of 'yes' / 'no.

2. What's the actual date format and column.format value.