简体   繁体   English

CascadingDropdown完成填充时的Javascript事件?

[英]Javascript Event For When CascadingDropdown Finishes Populating?

I have a State DDL and a Country DDL. 我有一个州DDL和一个国家DDL。 I have CascadingDropdown controls for each of those DDLs. 对于每个这些DDL,我都有CascadingDropdown控件。

When the user selects an entry from the Country DDL, the State dropdown gets populated with the results of a service method call. 当用户从“国家/地区” DDL中选择一个条目时,“状态”下拉列表将填充服务方法调用的结果。

I want to disable a submit button while the State dropdown is populating. 我想在填充状态下拉列表时禁用提交按钮。 Is there a way to capture when the State DDL finishes populating so that I can do this in JavaScript? 当State DDL完成填充时,有没有一种方法可以捕获,以便可以在JavaScript中完成此操作?

How are you calling your service method? 您如何称呼您的服务方式? Both the Microsoft AJAX library and jQuery offer a callback method when you execute an AJAX call. 当您执行AJAX调用时,Microsoft AJAX库和jQuery都提供了一种回调方法。 In your javascript function that calls the service, disable the button. 在调用该服务的javascript函数中,禁用该按钮。 Provide a callback to the AJAX call's 'onSuccess' (or whatever it is called) that turns it back on. 提供对AJAX调用的“ onSuccess”(或任何被称为)的回调,以将其重新打开。

Quick article on Microsoft AJAX PageMethods javascript class. 关于Microsoft AJAX PageMethods javascript类的快速文章。

jQuery ajax() method. jQuery ajax()方法。

据我所知,CascadingDropdown没有提供此类JavaScript事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM