I am using kendo ui grid to display data. I want to set title for the grid.Is there any way to set it.
Also I want to set some additional/custom property for grid which will help to identify the grid uniquely. Any custom property I can set to grid so I can get its value when required.
So in case if there are more instances on grid this will help.
Please suggest on this.
Iterating through all your tables can be done using:
If you want to add a title, might be something like:
For setting a click event to the HTML
img
elements, you can do:Once you click on the first image of each row what I do in the event handler is finding the closest HTML element with
k-grid
class (the grid): this is the HTML containing the grid.If you want to get Kendo UI
grid
element the you need to usedata("kendoGrid")
.Simple and elegant.
In this JSFiddle: http://jsfiddle.net/OnaBai/2qpT3/2/, if you click on "Add Titles" button you add a title to each table and if you click on "Add Handlers" and then in an image, you will get an alert with the
id
of the table that the image belongs to.EDIT: If you want to iterate on every image that is in the first column, of every KendoUI grid on your document, you should do:
I prefer to change the title like this: