Click here to Skip to main content
15,886,693 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am generating buttons dynamically based on the data. I have to assign the data-name attribute dynamically as well. The dynamic buttons generation is working properly.

but if i want to add a click (knockout js) event to these buttons, it returns an error at the run time that the knockout function is undefined.



here is my view

define(['services/logger', 'durandal/system'],
function (logger, system, staffheader) {
var title = 'Staff Review';

var StaffReviewRequestObject = ko.observable();

var vm = {
activate: activate,
StaffReview: ko.observable(),
ReviewCode : ko.observableArray(),
loadViewModel: ko.observable(),
buttonLoadModel: buttonLoadModel
};

return vm;

function activate() {
return true;
}
});

any suggestions, why the runtime cannot find the click event "buttonLoadModel" ???
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900