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
265
need help on IGcombo with checkbox
posted

Hi,

I have created one dynamic IGCombo with checkboxes.I have binded it with JSON.

Now on some conditions I want to disable checkboxes for one of the items from that IGCombo.

Can you tell me how to achieve this.

Thanks in advance.

Parents
No Data
Reply
  • 11095
    Suggested Answer
    Offline posted

    Hello,

    Thank you for contacting Infragistics Developer Support.
    If I understand correctly you want if some item is selected others to not be, please let me know if I am wrong. To do so you can use the selectionChanging event. If you return false the selection will be cancelled. In the ui variable you can select all candidate selection items with ui.items. Then check if there are any selected items and they are not from the restricted list. 

    $combo.igCombo({
        dataSource: colors,
        textKey: "Name",
        multiSelection: "onWithCheckboxes",
        valueKey: "Name",
        width: "200px",
        autoComplete: true,
        selectionChanging: function (evt, ui) {
            if (ui.items && selectedItemsContain(ui.items, ['Red', 'Brown'])) {
                return false;
            }                        
        }
    });

    I have attached a with the implementation of the selectedItemsContain. If you have any additional questions please let me know.

    igCombo-multiple-selection-on-condition.zip
Children
No Data