This is a migrated thread and some comments may be shown as answers.

change filter options in the grid wrapper

5 Answers 570 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Fernando
Top achievements
Rank 1
Fernando asked on 05 Nov 2019, 02:51 PM
hello, I am working with the grid wrap component, and my problem is that in the filters of my columns I do not need to use all the filter options (for example, it is equal to, it is not equal to, it is after .. ..), I would like to only use some of them .. is it possible to do this?

5 Answers, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 07 Nov 2019, 12:27 PM

Hello Fernando,

You could explicitly define which options to be rendered in each type of column filter present in the Grid. Here you could find a StackBlitz sample demonstrating that. It includes the following definitions for string and numeric filters:

filterableConfig:  {
  extra: false,
  operators: {
    string: {
      startswith: "Starts with",
      eq: "Is equal to",
      neq: "Is not equal to"
    },
    number: {
      lt: "Is less than",
      eq: "Is equal to",
      gt: "Is greater than"
    }
  }
}

Regards,
Veselin Tsvetanov
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Fernando
Top achievements
Rank 1
answered on 08 Nov 2019, 02:19 PM
Thank you very much, I could solve it. However, now I have another problem, I hope you can help me, previously I had the filter property in "row" mode (filterable-mode). Now I need to use a filter menu as the playback link of the example you passed, I cannot use these properties ( : filterable-cell-operator,: filterable-cell-suggestion-operator) so how can I tell you to default to a filter type for example: contains
0
Veselin Tsvetanov
Telerik team
answered on 12 Nov 2019, 10:20 AM

Hi Fernando,

May I ask you to send a StackBlitz sample demonstrating how you have used the filterable-cell-operator and filterable-cell-suggestion-operator options that are no longer configurable? You could use the already discussed sample as a starting point.

Regards,
Veselin Tsvetanov
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Fernando
Top achievements
Rank 1
answered on 12 Nov 2019, 02:32 PM
of course, this is the updated play link https://stackblitz.com/edit/bmbc6e-oghnqz?file=index.html
0
Veselin Tsvetanov
Telerik team
answered on 14 Nov 2019, 08:30 AM

Hi Fernando,

Thank you for the updated sample.

You should be able to keep the operator and suggestion-operator configuration by changing the filterable.mode to row. Those will be available only for the row mode of the Grid filter:

filterableConfig:  {
  mode: "row",
  extra: false,
  operators: {
  string: {
    startswith: "Starts with",
    eq: "Is equal to",
    neq: "Is not equal to",
    contains: "Contains"
  },
  number: {
    lt: "Is less than",
    eq: "Is equal to",
    gt: "Is greater than"
  }
}

Here you could find a modified version of the sample discussed implementing the above.

Regards,
Veselin Tsvetanov
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Fernando
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Fernando
Top achievements
Rank 1
Share this question
or