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
160
igCombo "select all" button in header template
posted

I have an igCombo that has a button in the header template.  The button has an "onclick='handleClick(this)'" specified.  How can I get a reference to the igCombo instance inside of the "handleClick()" function without using an id of the igCombo?

function igComboHeaderSelectAllHandler(e) {
 // use "e" to get a relative reference to the igCombo instance
}


// igCombo options
{
        dataSource: igComboDataSource,
        textKey: "Name",
        valueKey: "Name",
        allowCustomValue: false,
        autoComplete: true,
        enableClearButton: false,
        itemTemplate: "<span title=\"${Name}\"\>${Name}</span>",
        headerTemplate: "<div><input type='button' value='Select All' onclick='igComboHeaderSelectAllHandler(this)' /></div>",
        multiSelection: {
            enabled: true,
            showCheckboxes: true,
            itemSeparator: ','
        }

  • 16310
    Offline posted

    Hi,

    In this context "this" is the input html element itself, so you will not be able to pass a reference to the combo without using a selector. Please let me know if you have further questions.

    Hristo