Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
120
igCombo select all child items when clicking in group
posted
Hi

Is there any way to select all child elements after selecting the group
to which they belong when using the grouping and multiselect features
on igCombo?

http://codepen.io/anon/pen/VKbWbr

Here is a codepen with the code i am using

Thanks 
Parents
No Data
Reply
  • 11095
    Suggested Answer
    Offline posted

    Hello Paulo,

    In order to select group, onclick can be handled for the grouping header and then then the data source can be filtered to get only the items from that group and select the items by using the value method.

    $('.ui-igcombo-group-header').on('click', function() {
        var clickedGroup = $(this).text();

        var valuesToSelect = colors.filter(function(item) {
            return item.Type == clickedGroup;
        }).map(function(item) {
            return item.Name;
        });

        $('#checkboxSelectCombo').igCombo("value", valuesToSelect);
    });

    You can refer to the updated codepen.

    Let me know if you have further questions on this matter.

Children