i have many rows on mouseover of each row popup will open.
i need to close popup using javascript.
if i use
$('#myModal').modal('hide');
then on mouse over on graph sometimes it shows previous rows graph also
<asp:GridView ID="grdperformance" runat="server" Width="100%" BorderColor="#c4e7e7" BorderWidth="1px" OnRowDataBound="grdperformance_RowDataBound" AutoGenerateColumns="false" >
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<div class="col-md-8"> <label>Task Title</label></div>
<div class="col-md-4"> <label>Total Points</label></div>
</HeaderTemplate>
<ItemTemplate>
<div class="col-md-8"><a style="color:white;" onmouseover='Showpointchart("<%#Eval("Task_title")%>","<%#Eval("Remarks1")%>","<%#Eval("Points1")%>","<%#Eval("Remarks2")%>","<%#Eval("Points2")%>","<%#Eval("Remarks3")%>","<%#Eval("Points3")%>","<%#Eval("Remarks4")%>","<%#Eval("Points4")%>","<%#Eval("Remarks5")%>","<%#Eval("Points5")%>","<%#Eval("Remarks6")%>","<%#Eval("Points6")%>","<%#Eval("Remarks7")%>","<%#Eval("Points7")%>","<%#Eval("Remarks8")%>","<%#Eval("Points8")%>","<%#Eval("Remarks9")%>","<%#Eval("Points9")%>","<%#Eval("Remarks10")%>","<%#Eval("Points10")%>")' > <%# Eval("Task_title") %></a></div>
<div class="col-md-4">
<asp:Label ID="Label4" runat="server" Text='<%# Eval("Total_Points") %>'></asp:Label>
</div>
</asp:GridView>
<div class="col-md-12">
<div class="modal fade" id="myModal" role="dialog" onmousedown="hidepopup()" >
<div class="modal-dialog" style="width:700px">
<!-- Modal content-->
<div class="modal-content" >
<div class="modal-body" >
<span style="color:red"> <%--Click to Close--%></span>
<%--<br/>--%>
Employee Task Report
<div class="col-lg-12 col-sm-12 col-md-12 col-xs-12" >
<br /><br />
<div class="col-md-12">
<%--//taskchart--%>
<canvas id="bar-chart" width="500" height="300"></canvas>
</div>
</div>
</div>
<div class="modal-footer" >
<hr />
<button type="button" class="btn btn-info" onmouseover="hidepopup()" data-dismiss="modal">
Close</button>
</div>
</div>
</div>
</div>
function Showpointchart(title,remark1,point1,remark2,point2,remark3,point3,remark4,point4,remark5,point5, remark6,point6,remark7,point7,remark8,point8,remark9,point9,remark10,point10)
{
alert("ok");
$('#myModal').modal('show');
$('#myModal').on('shown.bs.modal', function () {
var ctx = document.getElementById("bar-chart").getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: [remark1, remark2, remark3, remark4, remark5, remark6, remark7, remark8, remark9, remark10],
datasets: [{
label: "Points",
data: [point1, point2, point3, point4, point5, point6, point7, point8, point9, point10],
backgroundColor: ["#3e95cd", "#8e5ea2", "#3cba9f", "#e8c3b9", "#c45850", "#3e95cd", "#8e5ea2", "#3cba9f", "#e8c3b9", "#c45850"]
}]
},
options: {
legend: {
display: false
},
scales: {
yAxes: [{
ticks: {
beginAtZero: true
}
}],
xAxes: [{
ticks: {
callback: function (value, index, values) {
// return only first 4 charater of remark.
return (value.substr(0, 10) + "..");
}
}
}]
},
tooltips: {
callbacks: {
title: function (tooltipItem, data) {
// Returns text to render as the title of the tooltip.
return data.labels[tooltipItem[0].index];
}
}
}
}
});
})
}
function hidepopup() {
$('#myModal').modal('hide');
}