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

Excel-like filter OnClientItemCheckedHandler

1 Answer 113 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jas
Top achievements
Rank 1
Jas asked on 15 Aug 2017, 09:21 AM

Hi,

I would like to call a JavaScript function whenever an item is checked/unchecked in the excel-like filter list.

Please assist with an example of how this could be achieved.

Thank you,

Jas

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 18 Aug 2017, 06:12 AM
Hi Jas,

You can achieve this requirement using the following approach:
protected void RadGrid1_FilterCheckListItemsRequested(object sender, GridFilterCheckListItemsRequestedEventArgs e)
{
    e.ListBox.DataBind();
 
    foreach (RadListBoxItem item in e.ListBox.Items)
    {
        item.Attributes.Add("onclick", "filterListBoxItemClicked(this,event);");
    }
}
JavaScript:
function filterListBoxItemClicked(el, event) {
    if (event.target && event.target.type == "checkbox" && event.target.checked) {
        alert($(el).text());
    }
}

I hope this will prove helpful.

Regards,
Eyup
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Jas
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or