{
sTitle: '', mData: 'id', bSearchable: 'false', bSortable: false, sWidth: '290px',
mRender: function (data, type, full) {
return "<button type='button' class='btn btn-primary' onclick =" + self.startResetPassword(full) + "></button>"
//return "<button type='button' id='ResetPassword' class='btn btn-primary' data-bind='click:{return self.startResetPassword("+full.id+");}'></button>"
//return "<button type='button' class='btn btn-primary btn-xs' data-bind='click: " + function () { return self.startResetPassword("+full.id+"); } + "'></button>"
}
}
以上按钮功能均无法正常工作
答案 0 :(得分:0)
放置像这样的点击处理程序并不受欢迎,我建议使用这样添加它:
mRender: function (data, type, full) {
return "<button type='button' class='btn btn-primary' data-button-id="+full.id+"></button>"
}
...
contentElement.on('click', 'button.btn-primary', function(){
var elementData = $(this).data('button-id');
self.startResetPassword(elementData )
});