CSSCommonJS.RenderTemplatefunction($(t.panelID).find("#ProductBilling"), $(t.panelID).find("#ProductBillingTemplate"), billingDetail);
//
$(t.panelID).find("#ProductBilling").children("dl").each(function (index) {
var tTr = this;
var selectedItem = $.tmplItem(this);
var bComboName = $(tTr).find("#bComboName");
var bTel = $(tTr).find("#bTel");
var n = selectedItem.data;
var curAcct = CSSCommonJS.GetCurrentUser(t.masterUser, n.AccountId); // n.BusinessAccountId);
var curpstn = "";
if (curAcct.AccountType == CSSAccountType.BB) {
if (curAcct.DID) {
if (curAcct.CountryCode == "1") {
curpstn = "(Tel:" + CSSCommonJS.FormatUSCAPhone(curAcct.DID) + ")";
}
else {
curpstn = "(Tel:" + curAcct.DID + ")";
}
}
else if (curAcct.BBNumber) {
curpstn = "(" + curAcct.BBNumber + ")";
}
}
else if (curAcct.AccountType == CSSAccountType.HY) {
curpstn = "(" + curAcct.HYNumber + ")";
}
else if (curAcct.AccountType == CSSAccountType.DSL) {
curpstn = "(" + curAcct.DSLNumber + ")";
}
bComboName.html(curAcct.ComboName);
bTel.html(curpstn);
if ((n.BillTransactions.length + n.RebateInstances.length + n.TopUpDetails.length) == 0) {
$(tTr).hide();
}
$(tTr).find(".border_none_special").each(function (spindex) {
var tdd = this;
var selectedItem = $.tmplItem(this);
var spamount = $(tdd).find("#spamount");
var spdescription = $(tdd).find("#spdescription");
if (t.currentAdmin.Valid) {
spamount.attr("title", spamount.attr("title").formatDate(t.masterUser, ""));
}
else {
spdescription.hide();
}
});
});
嵌套绑定是模板自动完成的。
您可能感兴趣的文章: