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

Custom text on template above column headers?

1 Answer 525 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 17 Jul 2019, 11:55 AM
I have a custom hidden div that appears when the user selects grid content. It sums the selected cells in the amount column and then binds it to this text. The text currently appears under my grid externally. I was actually wonder if there is a way to display that in the header above the column headers kind of like how the Export to Excel button is?

1 Answer, 1 is accepted

Sort by
0
Alex Hajigeorgieva
Telerik team
answered on 18 Jul 2019, 04:36 PM
Hi, Steven,

Thank you for trying out the jQuery Kendo UI Grid.

The grid features a toolbar.template that can be used.  I believe the easiest approach is to use the jQuery text() method and update the element when the grid change event is triggered:

https://dojo.telerik.com/@bubblemaster/EpoYolOR/2

Also, if you want to preserve the functionality of the grid Excel Export button, just add a button to the template with the "k-grid-export" class. The built-in click handler and export will be triggered out of the box:

<script id="template" type="text/x-kendo-template">
 <a class="k-button k-grid-excel" href="\#"><span class="k-icon k-i-excel"></span> Export To Excel</a>
 <div id="selection"></div>
</script>

Let me know in case you have further questions.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Steven
Top achievements
Rank 1
Answers by
Alex Hajigeorgieva
Telerik team
Share this question
or