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

Kendo Grid custom column filter UI

3 Answers 157 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 05 Dec 2018, 05:11 PM

We have a Priority boolean flag column

We want a grid filter that only returns rows that only have that flag

Can you please give a quick snippet of how to accomplish this:

a) Show two radio buttons for "Priority" "Not Priority"

b) Only show a radio button for "Priority" (with the radio button pre-selected since it's the only choice)

c) Use a drop-down with a preloaded value ... This is what I have at the moment - replacing the text input with a drop down list with only one value ... BUT for the lift of me I cannot pre-select that value - the user has to expand the drop-down and select the value

        $(param.element).kendoDropDownList({
            dataTextField: "text",
            dataValueField: "value",
            dataSource: [
                {
                    text: "Priority",
                    value: 0
                }
            ],
            index: 0
        });

d) using a custom UI ... the filter UI is just a form with some controls and form buttons, correct? - for the future I would really love to be able to create my own UI with my own inputs, and decide myself what value I want bound when the form is submitted

I tried switching the type on the text input (not shown) and I tried creating a cloned input element and switching the type (shown below) ... and it looks perfect, except on submit it's not recognized as a filter

$(param.element[0]).clone().attr('type', 'radio').attr('checked', true).addClass('avoPriorityFilterRadio').insertAfter(param.element[0]).prev().remove();
        $(".avoPriorityFilterRadio").after("<span>Priority</span>");

 

Appreciate any help - I've struck out with all of these options

Daniel

 

3 Answers, 1 is accepted

Sort by
0
Daniel
Top achievements
Rank 1
answered on 05 Dec 2018, 05:14 PM
I should add that on FilterMenuInit and FilterMenuOpen I am hiding the operator drop down ... all we are interested in is the Filter Value itself
0
Daniel
Top achievements
Rank 1
answered on 05 Dec 2018, 05:15 PM
I should add that on FilterMenuInit and FilterMenuOpen I am hiding the operator drop down - all we want to see is the Filter Value itself
0
Eyup
Telerik team
answered on 07 Dec 2018, 08:38 AM
Hi Daniel,

All points and questions correlate with point 4 - you can use customized filter UI to achieve all these requirements:
https://demos.telerik.com/kendo-ui/grid/filter-menu-customization

I hope this will prove helpful.

Regards,
Eyup
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
Daniel
Top achievements
Rank 1
Answers by
Daniel
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or