Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
385
Make selection on one parent WebDropDown, and cascade to multiple child WDDs?
posted

I'm modeling my code on this example: http://samples.infragistics.com/2010.3/WebFeatureBrowser/WebDropDown/WebDropDownCascadeClient.aspx

I have three WebDropDown controls: wdd1, wdd2, wdd3.

When wdd1 's selection  changes, I want new values to be cascaded to wdd2 & wdd3. I've tried to code it both server -side and client-side, and neither work. My code for server-side/client-side are the same except for the lines marked "comment-toggle".

Here is my js:

    function wdd1_SelectionChanged(sender, args) {

        // get the selected value of the current WDD (wddPayroleSite)
        value = args.getNewSelection()[0].get_value();
        cascadeWebDropdown(value);

        return;

    }

    function cascadeWebDropdown(value) {

        var wdd2 = $find('<%= wdd2.ClientID %>');
        var wdd3 = $find('<%= wdd3.ClientID %>');

        wdd2.loadItems(value);
        wdd3.loadItems(value); // comment-toggle

    }

Here is my VB.NET:

    Protected Sub wdd2_ItemsRequested(ByVal sender As Object, ByVal e As Infragistics.Web.UI.ListControls.DropDownItemsRequestedEventArgs) Handles wdd2.ItemsRequested

        Dim text As String = CType(e.Value, String)

        Dim id  As Integer = 0

        If (Integer.TryParse(text, id)) Then
            LoadWdd2(id)
            ' LoadWdd3(id) ' comment-toggle
        End If       

    End Sub

End VB.NET Code

LoadWdd2() & LoadWdd3() are functions that perform the databind to their respective WDD controls.

 

Also, how can I prevent the auto-opening of the child WDD? Going back to the sample, if I select a country, the state WDD opens and focuses automatically. I don't want this to occur.

 

 

Parents
No Data
Reply
  • 19693
    posted

    Hello ,

    The issue with auto-opening child is fixed in the latest service release.

    Regarding the cascading issue I tried to reproduce the behavior with the online sampe but with no avail.

    Can you please let me know what does LoadWdd2 method do?  (  LoadWdd2(id) )

    Where is the value variable declared ? I recommend you renaming it because by default the local variables override the global ones  (I mean cascadeWebDropdown(value) function)

    value = args.getNewSelection()[0].get_value();

    I am attaching the example I extrated from the online sample.

    Please refer to the zipped attachment.

    Sample_WDD_Cascade.zip
Children