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

Disable filters

5 Answers 87 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Kishore Kumar
Top achievements
Rank 1
Veteran
Kishore Kumar asked on 06 Jan 2021, 05:31 PM
Hi , how to disable the filters close button which are loaded intially?

5 Answers, 1 is accepted

Sort by
0
Kishore Kumar
Top achievements
Rank 1
Veteran
answered on 06 Jan 2021, 05:44 PM
$("#filter").kendoFilter({
                dataSource: dataSource,
                expressionPreview: true,
                applyButton: true,
                fields: [
                    { name: "name", type: "string", label: "Name" },
                    { name: "price", type: "number", label: "Price" },
                    { name: "description", type: "string", label: "Description" }
                ],
                expression: {
                    logic: "or",
                    filters: [
                        { field: "price", value: 5, operator: "gte" },
                        { field: "name", value: "salad", operator: "contains" }
                    ]
                }
            }).data("kendoFilter").applyFilter();
 
Am adding piece of code for explanation of my query . How to disable close option in UI  for one of the filter example filter. I hope u understood my query, give me the approach to proceed.
0
Nikolay
Telerik team
answered on 08 Jan 2021, 01:04 PM

Hello Kishore,

Are you referring to the below close button?

If so I can suggest appending CSS class .k-state-disabled via jQuery which will disable the button. For example:

 

$("button[title='Close']").addClass( "k-state-disabled" );

 

I have applied this to the Filter in the next Dojo demo:

Let me know if this is what you are looking for.

Regards,
Nikolay
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Kishore Kumar
Top achievements
Rank 1
Veteran
answered on 11 Jan 2021, 04:37 PM
Ya I am looking for that ,thank you 
0
Kishore Kumar
Top achievements
Rank 1
Veteran
answered on 11 Jan 2021, 04:43 PM

I have one more query  on this filter how to get default operator when we change field for example price field has operators in order neq,eq,contains,does not contain. Here if I change field from one to another am getting first one in the operator drop-down. I need contains when I change  to price option in field. 

 

I hope u understand my query,thank u In advance.

0
Nikolay
Telerik team
answered on 13 Jan 2021, 01:41 PM

Hello Kishore,

Thank you for sharing this scenario with me.

Unfortunately, the current API of the Filter widget does not expose options for default operators. However, this has been logged for enhancement and I recommend casting your vote for it at the below link:

This feature enhancement can be tracked also in the following GitHub issue:

Let me know if you have any questions.

Regards,
Nikolay
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Data Source
Asked by
Kishore Kumar
Top achievements
Rank 1
Veteran
Answers by
Kishore Kumar
Top achievements
Rank 1
Veteran
Nikolay
Telerik team
Share this question
or