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

hide Filtered values

2 Answers 207 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Roger
Top achievements
Rank 1
Roger asked on 18 Jun 2018, 10:14 AM

is it possible hide unselected items in filter popup dialogue of each column of spreadsheet control?
Basically, we need this works like Excel.

Please check link out to see what I need:
https://www.screencast.com/t/doeRvn0ayl8a

2 Answers, 1 is accepted

Sort by
0
Accepted
Neli
Telerik team
answered on 20 Jun 2018, 07:20 AM
Hi Roger,

To achieve the desired appearance I would suggest you to add a click event handler to the arrow button. When the arrow is clicked and the popup for filtering appears, you could find all the checkboxes through the '.k-checkbox' class. Then for each checkbox, if it is checked, you could hide the respective item. Note, that you will need to exclude the checkbox corresponding to the 'All' node (marked in orange below). In order to ensure, that the checkboxes are rendered by the time you are trying to check their values, you will need to use setTimeout function.

$('.k-icon.k-i-arrow-60-down').click(function(){
           
    setTimeout(function(){
        var checkboxes = $('.k-checkbox');     
        for(var p=0; p < checkboxes.length; p++){
            var checked = checkboxes[p].checked;
            if(!checked){                     
                $(checkboxes[p]).closest('.k-item').not('.k-first').hide()
            }
        }                          
    }, 0)
})

Here you will find a Dojo example, where the approach described above is implemented.
I hope this helps.

Regards,
Neli
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Roger
Top achievements
Rank 1
answered on 21 Jun 2018, 06:57 AM

that why I prefer Kendo controls. Tested & it works like a charm.

Thank you so much.  

Tags
Spreadsheet
Asked by
Roger
Top achievements
Rank 1
Answers by
Neli
Telerik team
Roger
Top achievements
Rank 1
Share this question
or