Reputation: 693
I have kendo toolbar where I have one button for export and on left side of the header I want to add text dynamically from the dataSource but I am not sure how to get data for kendo toolbar items, For columns I know if we add template function that provides the data but for that partticular row. How can I get the data for toolbar so I can display the text that is part of dataSource ?
config.js
toolbar: [
{
template: '<button class="btn btn-default k-grid-excel btn-sm pull-right">Export to Excel</button>',
},
{
template:function(dataBound) {
console.log("data",dataBound);
return '<p class="pull-left"><strong>this.dataItem.epcfName</strong></p>'
}
}
]
Upvotes: 0
Views: 1274
Reputation: 126
In toolbar component I execute a command like this in console:
$("#toolbar").data("kendoToolBar");
There is no datasource, but I think you will find items in:
$("#toolbar").data("kendoToolBar").options.items;
Upvotes: 1