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

Set grid event programmatically?

3 Answers 347 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 22 Dec 2014, 06:19 PM
Hi, I was wondering how I could programmatically do this in javascript as I want to make a re-usable javascript function for initializing common grid settings:

.Events(events => events.Change("kendoGridWithCheckboxColumnSelectionOnChange"))

3 Answers, 1 is accepted

Sort by
0
Accepted
Alexander Popov
Telerik team
answered on 24 Dec 2014, 11:29 AM
Hi Bob,

Attaching event handlers programmatically is done using the bind method. For example: 
var grid = $("#myGrid").getKendoGrid();
grid.bind("change", kendoGridWithCheckboxColumnSelectionOnChange);

Regards,
Alexander Popov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Thomas
Top achievements
Rank 1
answered on 05 Jul 2017, 11:46 PM

Hi Alexander,

whats the propper way of binding the data function ? (for setting parametes on the read method).

So far I have tried:

            this.mainResultGrid = $("#grid").getKendoGrid();


            this.mainResultGrid.bind("data", this._searchParametersForMainGrid);

            this.mainResultGrid.bind("read.data", this._searchParametersForMainGrid);

 

without success

thanks

0
Milena
Telerik team
answered on 07 Jul 2017, 11:32 AM
Hello,

Please try the code below and verify how it works on your side:
var grid =$("#myGrid").getKendoGrid().dataSource;
grid.transport.read.bind("data",this._searchParametersForMainGrid);


Regards,
Milena
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
Bob
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Thomas
Top achievements
Rank 1
Milena
Telerik team
Share this question
or