开发者

Change on of the 5 drop downs in the cascading drop down list sequence manually, but have the cascading effect work anyway

I have a form which has 5 cascading drop downs (Asp.Net AJAX). I need to now set the value of the 2nd drop down manually (via javascript), but have the remaining drop downs cascade based on the value I set.

I have tried the following options, but none of them seem to help in resolving the issue:

  1. $find("cddName").set_SelectedValue(value, ''); - This one does not even seem to change the selected value in the dropdown. Is there something wrong I'm doing with this syntax?
  2. _onParentChanged(null, null) - It does not seem to trigger anything
  3. raiseSelectionChanged(null) - Even this does not seem to trigger anything.

Am I missing something or is there an easy way to have this done?

I am also using jQuery 开发者_JAVA百科and if I set the val() of the dropdown using jQuery, it does set it (the value of the dropdown), however, none of the remaining cascading behavior gets executed.

Thanks in advance for any suggestions :)


I figured what I had missed out (I guess had not been explicitly mentioned anywhere). The _onParentChange() function needs to be called on the cascading drop down object of each of the children that need to be updated.

So, yes, the _onParentChange(null,null), works fine. Its just that you need to call that on all the cascading drop downs that need to be updated, not on the one that you are changing the value of.

Example:

  • DD1 - CDD1
  • DD2 - CDD2
  • DD3 - CDD3
  • DD4 - CDD4

  • DD2 is dependent on DD1

  • DD3 and DD4 are dependent on DD2

The steps you would follow are:

  1. Update the selected value of DD2
  2. Get the objects for CDD3 and CDD4
  3. Call the _onParentChange(null,null) for both CDD3 and CDD4.

This will update the values in CDD3 and CDD4.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜