Grid onChange event does not trigger

1 Answer 3579 Views
Grid
morteza
Top achievements
Rank 1
morteza asked on 27 Jun 2018, 11:39 AM

I created a separate class in .js file to create grid for me,my class is simple as following:

 

function createDynamicGrid(chartId, source, column, titleOfGrid,onChange) {
        chartId.kendoGrid({
        toolbar: titleOfGrid,
        dataSource: {
            data: source,
        },
       change: onChange,
        height: 350,
        scrollable: true,
        sortable: true,
        filterable: true,
        columns: column,
        noRecords: {
            template: "No data"
        },
        });
}

 

in my cshtml file ,i call the above class ,pass the parameters and get the grid,but the onChange event does not trigger :

createDynamicGrid($("#grid"), dataSource, clmns, change);

function onChange(e){

 

//here i should get the clicked event ,but cant!

}

 

 

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Alex Hajigeorgieva
Telerik team
answered on 29 Jun 2018, 10:21 AM
Hi, Morteza,

Thank you for the explanation.

For the change event handler to work, the Kendo UI Grid should be selectable:

https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/selectable

I tested the same function with an external js file and had no issues triggering the change event handler. Please find the test code attached here for your reference.

Let me know if further questions arise.

Regards,
Alex Hajigeorgieva
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.
Tags
Grid
Asked by
morteza
Top achievements
Rank 1
Answers by
Alex Hajigeorgieva
Telerik team
Share this question
or