Hi All,
I have a page which call a partial view page and all the command buttons lost their click event once returned. I called a function from the dataBound of the grid to rebind the click event for the buttons and it works, but how do I rebind for a template dropdown?
...
dataBound: function(e) {
rebindGridObjects();
},
columns:[{
field: 'ReportList.Description',
title: 'In Reports',
width: 135,
template: "#=reportTemplate(ReportList,Report.Description)#",
editor: function invoiceReportsDropDown(container, options) {
if (options.model.ReportList.length <= 1)
return;
$('<input data-text-field="Description" class="reportListItems" data-value-field="Id" data-bind="value:' + options.field + '"/>')
.appendTo(container)
.kendoDropDownList({
dataSource: options.model.ReportList,
dataTextField: "Description",
dataValueField: "Id",
change: function (e) {
selectedReport = e.sender.value();
......
}
}
});
},
{
command: [
{
name: "test",
text: "test",
click: testLogic
}
],
title: "",
width: 90
},
function rebindGridObjects(e) {
$("#igrid .k-grid-content").find(".k-grid-test").bind("click", function(e) { testLogic($(this)); }); //work with command button
}
function reportTemplate(){
..getting the report
}
TIA