Hello all, i have a grid cell click method implemented using jquery as follows
function usercellclick() {
$("#<%=dgv_buslayout.ClientID%> tr:has(td)").click(function (e) {
var selTD = $(e.target).closest("td");
var $target = $(e.target);
if (!$target.is('input:checkbox')) {
$($target).find('input:checkbox').each(function () {
if (!$(this).prop('disabled')) {
if (this.checked) {
this.checked = false;
getseats();
}
else {
this.checked = true;
getseats();
}
}
})
}
});
});
function getseats() {
seatCheckUncheck(document.getElementById("<%= txtselectedseats.ClientID %>"), document.getElementById("<%=txtseatcount.ClientID %>"));
OnSuccess();
}
function OnSuccess() {
var seatsCount = document.getElementById("<%= txtseatcount.ClientID %>").value;
if (seatsCount == 0) {
var row = $("[id*=dgv_passengerdetails] tr:last").clone(true);
$("[id*=dgv_passengerdetails] tr").not($("[id*=dgv_passengerdetails] tr:first-child")).remove();
$("td", row).eq(0).html('');
$("[id*=dgv_passengerdetails]").append(row);
}
else{
var row = $("[id*=dgv_passengerdetails] tr:last").clone(true);
$("[id*=dgv_passengerdetails] tr").not($("[id*=dgv_passengerdetails] tr:first-child")).remove();
var seats = (document.getElementById("<%= txtselectedseats.ClientID %>").value).split(",");
for (var count = 0; count < seatsCount; count++) {
$("td", row).eq(0).html(seats[count]);
$("[id*=dgv_passengerdetails]").append(row);
row = $("[id*=dgv_passengerdetails] tr:last").clone(true);
}
}
}
when i click continue 6 7 times it throws an exception as Maximum call stack size exceeded
if i remove the else part of function OnSuccess() then it works fine. help me, thanx in advance