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

Attaching custom event to DataBound Library Event

1 Answer 154 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 31 Aug 2016, 03:15 PM

Hello,

I want to implement some custom functionality for the grid: adding column sort orders to the column header and aligning them (along with the sort arrow) to the left.

Dojo: http://dojo.telerik.com/IWInE

From the code you can see that I'm doing this one the dataBound event. I don't want to have to put this code into every single grid I have.

Is there anyway to easily add this code to the kendo library so that it is called before the grid's individual dataBound function is called?

Thank you,
Dan

1 Answer, 1 is accepted

Sort by
0
Stephen
Top achievements
Rank 2
answered on 01 Sep 2016, 08:33 PM

Maybe create a custom Grid that derives from the Kendo Grid?

(http://docs.telerik.com/kendo-ui/intro/widget-basics/create-custom-kendo-widget)

Check out the "MyGrid" implementation here: http://dojo.telerik.com/@Stephen/iRUCA for an rough implementation.

Note how I had to make the jquery selectors more specific using .find()(to just find elements within the "current" grid) so that you can have more than 1 grid on the page without clicking 1 header affecting all the other grids as well.

Then you get use $("#grid").kendoMyGrid() instead of $("#grid").kendoGrid() when you init your grids.

 

 

 

 

Tags
Grid
Asked by
Dan
Top achievements
Rank 1
Answers by
Stephen
Top achievements
Rank 2
Share this question
or