function BindGridViewA() { var txtValue = $("#<%=txtAssets.ClientID%>").val(); var LgrGrpId = window.location.search.toString(); $.getJSON('BalanceSheet1.ashx?LgrGrpType=A&Search=' + txtValue + '', function (BankStatement) { debugger; var data = BankStatement; var AltColor = "#FAF9F2"; if (LgrGrpId != '') { var queryStringColl = null; //Get querystring from url var requestUrl = window.location.search.toString(); if (requestUrl != '') { //window.location.search returns the part of the URL //that follows the ? symbol, including the ? symbol requestUrl = requestUrl.substring(1); queryStringColl = new Array(); //Get key:value pairs from querystring var kvPairs = requestUrl.split('&'); for (var i = 0; i < kvPairs.length; i++) { var kvPair = kvPairs[i].split('='); LgrGrpId = kvPair[1]; } } } $("#<%=gdvAssets.ClientID%>").empty(); $("#<%=gdvAssets.ClientID%>").append("<tr style='font-weight:bold;background-color:#96CDCD'><th>Assets</th><th align='right'></th></tr>"); for (var i = 0; i < data.length; i++) { if (AltColor == "#FAF9F2") { AltColor = "white"; } else { AltColor = "#FAF9F2"; } $("#<%=gdvAssets.ClientID%>").append("<tr style='background-color:" + AltColor + ";border-removed 1px solid #E7DFBD;'>" + '<td><a href="../Account/BalanceSheet.aspx?LgrGrpId=' + data[i].LgrGrpId + '">' + data[i].Name + '</a></td>' + '<td align="right">' + commaSeparateNumber(data[i].DrAmount) + '</td>' + '</tr>'); if (LgrGrpId != '') { $.getJSON('BalanceSheet1.ashx?LgrGrpType=L&LgrGrpId=' + LgrGrpId + '', function (Lgrs) { var data1 = Lgrs; for (var h = 0; h < data1.length; h++) { if (data[i].LgrGrpId == LgrGrpId) { $("#<%=gdvAssets.ClientID%>").append("<tr>" + '<td align="Left"> ' + data1[h].Name + '</td>' + '<td align="Left">' + commaSeparateNumber(data1[h].DrAmount) + '</td>' + '</tr>'); } } }); } } }); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)