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

Grid Filtermenu Auto open drop down.

3 Answers 194 Views
Grid
This is a migrated thread and some comments may be shown as answers.
im
Top achievements
Rank 2
im asked on 18 Apr 2013, 08:27 PM
I have a grid and have enabled the filter menu. I have removed the options "contains, equals to , and so on..." So all thats left is a kendoDropDownLIst with the available options for that particular column, and the Filter and Clear buttons. What Id like to do it, when the user opens the filter menu, that the dropDownList, will automaticallt open as well, so the user can select the appropriate value. I know its just saving one click, but the user wants that functionality... go figure...

Any ideas?

3 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 22 Apr 2013, 01:54 PM
Hi Derek,


To achieve this you could get the data for the DropDownList in the Filter Menu and use it's open method to open it along with the menu. 
E.g.
$("#Grid .k-filter").on("click", function (e) {
    var filterMenu = $(this).closest(".k-filterable").data("kendoFilterMenu");
    setTimeout(function (e) {
        var dropdown = filterMenu.form.find("[data-role='dropdownlist']").data("kendoDropDownList");           
        dropdown.open();
    });
});

Please let me know if this approach is working in the current scenario.

 

Regards,
Dimiter Madjarov
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
im
Top achievements
Rank 2
answered on 02 May 2013, 10:35 PM
This actually didnt work unfortunately. I am also hiding the search type using the folowing code

 function onFilterMenuInit(e) {
            e.container.find("span.k-dropdown:first").css("display", "none");
        }

so when I added your code all it does is display the "Contains" dropdown, but it also shows it in a strange position near the edge of the grid, which is the one I actually am hiding above.

0
Atanas Korchev
Telerik team
answered on 03 May 2013, 11:34 AM
Hello Derek,

 We are not sure what "hiding the search type" means. Could you please provide more code? 

 To open a dropdownlist you basically need to find it in DOM and call its open method as Dimiter suggested earlier. 

All the best,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
im
Top achievements
Rank 2
Answers by
Dimiter Madjarov
Telerik team
im
Top achievements
Rank 2
Atanas Korchev
Telerik team
Share this question
or