ASP.NET 3.5 AJAX 控件工具包 PopupControlExtender
ASP.NET 3.5 AJAX Control ToolKit PopupControlExtender
我试图通过传递一些参数来概括 PopupControlExtender 的 .add_hiding,但由于某些原因它不起作用。
function onPageLoad() {
var modalPopup = $find('txbCliente_PopupControlExtender');
modalPopup.add_hiding(onHidingPopUp('cblCliente','txbCliente'));
}
function onHidingPopUp(cblId, txbID) {
var cbl = document.getElementById(cblId);
var optionsIds = cbl.getElementsByTagName('input');
var optionsLabels = cbl.getElementsByTagName('label');
var varios = false;
var txb = document.getElementById(txbID);
var text = "";
for (var i = 0; i < optionsIds.length; i++) {
if (optionsIds[i].checked && varios) {
text = "Mútiplos Valores.";
break;
}
else if (optionsIds[i].checked && !varios) {
varios = true;
text = optionsLabels[i].textContent;
}
}
txb.value = text;
}
您将调用 onHidingPopUp('cblCliente','txbCliente')
的结果而不是函数本身传递给 add_hiding
方法。如果要将预定义参数传递给函数,请将其包装在另一个函数中:
modalPopup.add_hiding(function() {
onHidingPopUp('cblCliente','txbCliente')
});
如果你只有一个参数,你也可以使用 MS Ajax Function.createCallback
extension:
modalPopup.add_hiding(Function.createCallback(onHidingPopUp, 'cblCliente'));
我试图通过传递一些参数来概括 PopupControlExtender 的 .add_hiding,但由于某些原因它不起作用。
function onPageLoad() {
var modalPopup = $find('txbCliente_PopupControlExtender');
modalPopup.add_hiding(onHidingPopUp('cblCliente','txbCliente'));
}
function onHidingPopUp(cblId, txbID) {
var cbl = document.getElementById(cblId);
var optionsIds = cbl.getElementsByTagName('input');
var optionsLabels = cbl.getElementsByTagName('label');
var varios = false;
var txb = document.getElementById(txbID);
var text = "";
for (var i = 0; i < optionsIds.length; i++) {
if (optionsIds[i].checked && varios) {
text = "Mútiplos Valores.";
break;
}
else if (optionsIds[i].checked && !varios) {
varios = true;
text = optionsLabels[i].textContent;
}
}
txb.value = text;
}
您将调用 onHidingPopUp('cblCliente','txbCliente')
的结果而不是函数本身传递给 add_hiding
方法。如果要将预定义参数传递给函数,请将其包装在另一个函数中:
modalPopup.add_hiding(function() {
onHidingPopUp('cblCliente','txbCliente')
});
如果你只有一个参数,你也可以使用 MS Ajax Function.createCallback
extension:
modalPopup.add_hiding(Function.createCallback(onHidingPopUp, 'cblCliente'));