関数 YR.printGraphs() があります。これにより、多数の ajax 呼び出しが行われ、グラフがプロットされます。
すべての ajax 呼び出しの完了後にスクリプトを実行する必要がありますが、実行できません。私は以下を試しましたが、延期された方法も私にとってはうまくいっているようです。
関数「sangeetha」は起動しません。私は何を間違っていますか?
$("#pnlEmail1").ready(function () {
YR.printGraphs();
}).sangeetha();
function sangeetha() {
var s = 0.0;
$(".printgraphs").each(function () {
s += parseFloat($(this).height());
});
s = s - parseFloat($("#pnlEmail1").height());
$(".fulldtls").css({ "top": s + "px", "position": "relative" });
}
printGraphs: function () {
///<summary>Loop through the email metrics available for this customer and makes ajax calls to get the email graph data.</summary>
$(".printgraphs").each(function () {
//Every div id is generated with its respective tab name in printreport.cs to distingush graphs.
// So, check if the div belongs to Email tab, Phone tab or Grades and send the respective tab name to controller to get the correct graph data.
if ($(this).attr("id").toLowerCase().indexOf("email") >= 0) {
YAHOO.Report.changeGraph("Email", $(this), true);
}
else if ($(this).attr("id").toLowerCase().indexOf("grade") >= 0) {
YAHOO.Report.changeGraph("Grades", $(this), true);
}
else {
YAHOO.Report.changeGraph("Phone", $(this), true);
}
});
}
すべての YAHOO.Report.changeGraph は ajax 呼び出しを行います。jQuery での関数チェーンについて聞いたことがありますが、このシナリオでそれを適用する方法がわかりません。