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

Disable filter operators for all columns in row filter mode

3 Answers 497 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 28 Jun 2017, 03:57 AM

Hi

Is it possible to disable the operators button for all cells (in row filter mode) without having to apply it to every column.

At the moment I have the code below but ideally just want this applied at a more global level

    columns.Bound(c => c.JobTitle).Width(400).Filterable(f => f.Cell(cell => cell.ShowOperators(false)));

Thanks

Andy

3 Answers, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 29 Jun 2017, 01:26 PM
Hi Andrew,

There is no built in functionality to disable the operators button for all cells in row filtering mode globally. To avoid code duplication you can hide the buttons using the CSS from the following code snippet:

th [role="listbox"]{
      visibility: hidden;
}

The following dojo sample demonstrates how the aforementioned approach behaves:


Have in mind that hiding the buttons with CSS wont remove them from the DOM. In case you want to completely remove the buttons, you can remove them using JavaScript after the document is "ready".

The dojo below illustrates how to remove the buttons with JavaScript: 


Since both aforementioned approaches are client-side, the examples from the dojos are applicable for Kendo UI Grid for ASP.NET as well.


Regards,
Georgi
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Brian
Top achievements
Rank 1
answered on 21 Jan 2019, 11:39 AM
Hi, is there still no better way of doing this?
I have added this code to a global grid databound event to disable the operators on all grids across our application and it does work. However it literally just removes the button from view, it still leaves the space that the button occupied, i.e. the filter textblock does not expand to fill where the button was and so we are left with a blank space to the right which isn't a great look.
0
Georgi
Telerik team
answered on 23 Jan 2019, 08:20 AM
Hello Brian,

You could expand the inputs using css.

e.g.

<style>
  .k-filtercell span{
    width:100%;
  }
</style>

Below you will find a modified version of the sample:



Regards,
Georgi
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Andrew
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Brian
Top achievements
Rank 1
Share this question
or