This project is read-only.

MVC 5 TreeView vavolo alert

Mar 27, 2014 at 5:10 AM

I'm trying to create a project using MVC 5 and the Treeview control. I used VS 2013 MVC template as a starting point and manually added the references to the controls toolkit.
Being a little inexperienced with MVC/web development I had a few initial issues. I have finally gotten to a point where I don't know where to look next.

It seems to render correctly, the issue is when I expand the root treeview node in edit mode it is raising an alert which is a little annoying. I was wondering if anyone had any ideas as to what is causing it. Any help would be much appreciated.

Included scripts
Treeview code (yes I used the example as a starting point)
<div id="treetobind">

            m => m.Locations,
            i => i == 0 ? "Locations" : null,
            null, // "filetree treeview-red treeToedit",
            new object[] {
                _S.L<RegionElement>(h => 
                    "<span class='region'>" + h.DisplayFor(m => m.Name).ToString() + "</span>"),
                _S.L<LocationElement>(h => 
                    "<span class='location'>" + h.DisplayFor(m => m.Name).ToString() + "</span>")
            (x, y) => x is RegionElement ? 0 : 1,
            null, // "filetree treeview-red treeToedit",
            new object[] {
             _S.L<RegionElement>(h => string.Format(
                     "<div class='region' >{0} {1} {2} {3}</div>",
                     h.TypedEditDisplayFor(m => m.Name, simpleClick: true).ToString(),
                     h.TreeViewAddButton(1, Url.Content("~/Content/document_add_16.png"),
                     h.Hidden("IsFolder", true).ToString())),
                _S.L<LocationElement>(h => string.Format(
                    "<div class='location' >{0} {1} {2}</div>",
                    h.DisplayFor(m => m.Name).ToString(),
                    h.Hidden("IsFolder", false).ToString())) 
            (x, y) => x is RegionElement ? 0 : 1,
            (x) => "allnodes",
            (x, y) => TreeViewItemStatus.Hide

            m => m.Locations,
            "Edit Folders", "TreeViewEdit",
            "Undo Changes", "TreeViewUndo",
            "Redo Changes", "TreeViewRedo")
Model being used in the page
    public class LocationModel : ISafeCreation
        [Required, Format(NullDisplayText = "empty name")]
        public String Name { get; set; }

    public class RegionElement : LocationModel
        public IList<LocationElement> Locations { get; set; }

    public class LocationElement : LocationModel


    public class testModel
        public List<LocationModel> Locations { get; set; }
Snippet of generated code with the alert
 <script language='javascript' type='text/javascript'>
                var Locations___Choice2___flattened___0_RootNamePostfix='Locations___Choice2___flattened';
                    var jQueryRoot = $('#Locations___Choice2___flattened___0_ItemsContainer');
                        if (jQueryRoot.hasClass('ui-sortable')) return true;
                        jQueryRoot.sortable({ handle: '.Locations___Choice2___flattened___0_handle',     connectWith: '.allnodes_Locations___Choice2___flattened',  
                                    update: function(event, ui) {MvcControlsToolkit_TreeView_UpdatePermutations(ui.item, 'Locations___Choice2___flattened___0_ItemsContainer'); },
                                    start:  function(event, ui) {MvcControlsToolkit_TreeView_StartDrag(ui.item, jQueryRoot);},
                                    stop:   function(event, ui) {MvcControlsToolkit_TreeView_StopDrag(ui.item, jQueryRoot);}
                        return true;
Mar 27, 2014 at 2:54 PM
Hi Krypt,
It is a bug. we added this alert while debugging the code, to resolve an issue, and then someone forgot to clean up the code.
Next week we will put on line the corrected dlls, both on nuget and on codeplex.
Marked as answer by Krypt on 3/27/2014 at 6:04 PM
Mar 28, 2014 at 2:04 AM
Cool, thanks for the quick reply
Mar 31, 2014 at 3:16 PM
New bug fixed 2.55 release available both on nuget and in the download aread (UpdatedBinaries file).