Tri-state ClientEntryAdding/Removing

3 posts, 1 answers
  1. Steve
    Steve avatar
    24 posts
    Member since:
    Mar 2012

    Posted 26 Feb 2013 Link to this post

    Hello,

    I have been working to add the new DropDownTree control to my project and noticed an undesired behavior when using it in Tri-state mode.  While checking the boxes visually does display correctly, it doesn't appear that the correct values are getting passed through the OnClientEntryAdding and OnClientEntryRemoving events using this method which you have on your help pages (which I actual found under RadAutoCompleteBox because the help for RadDropDownTree is useless and incomplete):

    <script type="text/javascript">
        function entryAdding(sender, eventArgs) {
            alert(eventArgs.get_entry().get_value());
        }
        function entryRemoving(sender, eventArgs) {
            alert(eventArgs.get_entry().get_value());
        }
    </script>


    For example, using hierarchical tree such as:

    [ ] Arizona
     -- [ ] Phoenix
     -- [ ] Tuscon
     -- [ ] Flagstaff
    [ ] California
     -- [ ] San Diego
     -- [ ] San Francisco
     -- [ ] Hollywood

    ...If I check "Arizona", on the UI "Phoenix, Tuscon, and Flagstaff" all get checked as expected, however; "Arizona" appears to be the only value actually returned from the entryAdding alert whereas I would expect to see "Arizona, Phoenix, Tuscon, and Flagstaff" .  Additionally, if I decide to uncheck say Tuscon, the UI does display this correctly and "Arizona" renders as the third state check, however; once again only "Arizona" is returned from the entryAdding alert whereas I would expect to see "Arizona, Phoenix, and Flagstaff".

    What am I missing here to get this to return the correct values to mimic what is shown on the UI side?

    Regards,
    Steve
  2. Answer
    Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 27 Feb 2013 Link to this post

    Hi Steve,

    The EntryAdding and EntryRemoving events are fired only for the checked/unchecked nodes, because they are cancelable . For the entries that are added/removed as a result of node checking/unchecking only EntryAdded and EntryRemoved events are fired.

    All the best,
    Peter Filipov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Steve
    Steve avatar
    24 posts
    Member since:
    Mar 2012

    Posted 27 Feb 2013 Link to this post

    Excellent, thank you for the assistance.
Back to Top