我想要一个按钮来调用onclick函数,但事实并非如此。我尝试了ng-click哪个不起作用。但是,当我尝试点击它时,它表示我的功能未定义。我怎样才能做到这一点?
谢谢。
自定义工具提示的功能:
function createCustomHTMLContent(img, evtTime, cmname, evt, cust, serv, descr, duration) {
var html ='<script type="text/javascript" src="validate.js"></script><div class="myclass" style="padding:5px 5px 5px 5px;width: 300px;height: 350px;">' +
'<img src="'+img+'" style="width:285px;height:230px">' +
'<table>'+'<tr>'+
'<td><strong>Date :</strong></td>' +
'<td><b>'+evtTime+'</b></td>' + '</tr>' + '<tr>' +
'<td><strong>Event Type :</strong></td>' +
'<td><b>'+evt+'</b></td>' + '</tr>' + '<tr>' +
'<td><strong>Customer :</strong></td>' +
'<td><b>'+cust+'</b></td>' + '</tr>' + '<tr>' +
'<td><strong>Severity :</strong></td>' +
'<td><b>'+serv+'</b></td>' + '</tr>' + '<tr>' +
'<td><strong>Description :</strong></td>' +
'<td><b>'+descr+'</b></td>' + '</tr>' + '<tr>' +
'<td><form ng-form-commit name="myForm" action="" onsubmit="testfunt()" target="dummyframe" method="post" novalidate><div class="row"><div class="text-center"><button ng-click="timeline.heyfun();">View Video</button></div></form></div></td></tr></table>';
return html;
}
function addData() {
rows.push([""+cmname, ""+id,createCustomHTMLContent(thumbpath, evtTime, cmname, evt, cust, serv, descr, 0),new Date(datetime), new Date(datetime1),'color:'+colors[serv]]);
tc.dataTable.addRows(rows);
var options = {
width : $scope.width,
height: $scope.height,
title: 'Timeline',
hAxis: {
title: 'Date',
format:'yy-MM-dd\n\nHH:mm:ss'
},
timeline: { //colorByRowLabel: true,
showBarLabels: false},
// backgroundColor: '#ffd',
colors: grapghcols,
// This line makes the entire category's tooltip active.
focusTarget: 'category',
// Use an HTML tooltip.
tooltip: { isHtml: true,}
};
tc.chart.draw(tc.dataTable, options);
$compile(tc.dataTable)($scope);
}
有很多代码。所以我试图包括所需的相关片段。如果您需要更多详细信息,请与我们联系。