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

How to globally customize a class?

3 Answers 34 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kyle
Top achievements
Rank 1
Kyle asked on 15 Jan 2013, 03:16 PM
With a Kendo UI Grid component I am doing the following to get 'titles' on my cells:

    var myGrid = $("#myGrid").kendoGrid({
         ...,
        dataBound: function(e) {
            // Set the title for all of the cells
            $("#myGrid td").each(function() {
                $(this).attr('title', $(this).text());
            });
         }
    }).data("kendoGrid");

But I have multiple grids spread throughout my app on multiple pages. I don't want to copy/paste this code everywhere.

How would I go about extending the kendoGrid, so that all kendoGrid components will inherit this functionality?
I have purchased Kendo UI and do have the source code, but I would prefer not to make direct changes, so that I can update easier at later dates.

3 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 16 Jan 2013, 08:13 AM
Hello Kyle,

I would go with a more simple implementation that inheriting/extending the grid. Create a simple function which hides the implementation detail or as simple jQuery plugin. Here is a sample implementation:
http://jsbin.com/eyuqox/1/edit

All the best,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Kyle
Top achievements
Rank 1
answered on 22 Jan 2013, 08:08 PM
Hey Nikolay,
The sample you provided is blank? 

$(function() {
  
  
});


Would it be possible to update it?

Thanks!
0
Accepted
Nikolay Rusev
Telerik team
answered on 23 Jan 2013, 10:07 AM
Hello Kyle,

Sorry about that. I'm not sure how did that happen. Here is an updated sample: http://jsbin.com/eyuqox/2

Regards,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
Kyle
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Kyle
Top achievements
Rank 1
Share this question
or