We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Drag and Drop to empty TreeView results in Error - How to prevent drops as Child Nodes

VS 2013
MVC 12.1.0.49
IE 11

I'm unable to drag from one tree to another when the destination tree is empty. Using IE I receive an error. A screen shot is in the project in the folder _ScreenShots. I've tried with UnobtrusiveJavaScriptEnabled enabled and disabled.  When UnobtrusiveJavaScriptEnabled  is true the results are much worse, the screen shot is when UnobtrusiveJavaScriptEnabled is false.

One more question, is there way to prevent nodes from dropping "into" a child node? In other words I would like only a single level list and not necessarily a tree.

The attached file contains the complete test project.

Thanks,

Rick



Attachment: TestSfMVC_1e813c53.zip

9 Replies

RT Rick Thompson June 18, 2014 05:52 PM UTC

I should have added that I get the error while dragging right near the top line of the Tree. This happens both with and without existing nodes in the tree. The error is "Error: Unable to get property 'nodeName' of undefined or null reference".

Thanks,

Rick


RT Rick Thompson June 18, 2014 06:43 PM UTC

So, maybe it's just me, but the MVC (non-classic) TreeView seems to "be a mess".

I have DropChild and DropSibling, yet I can drag and drop anywhere in the tree.

Is there any documentation that describes, for example, how to prevent dropping on a particular node?

Compared to the original test uploaded I created a root node in each tree, since it seems there needs to be at least one node to drop onto. That's fine and I can drop onto the root node and the node dropped becomes a child node. What I don't want is to be able to drop onto a child node therefore making it a parent.

Thanks,

Rick


RT Rick Thompson June 18, 2014 09:12 PM UTC

When ShowCheckbox is true the check event fires for every item checked in the tree. This doesn't seem correct. I would expect the check event to fire ONLY after the creation of the TreeView AND the user checks a checkbox.

Thanks,

Rick


RT Rick Thompson June 18, 2014 09:14 PM UTC

Sorry, need to qualify this - the check event fires for every checked item during the creation of the TreeView.



RT Rick Thompson June 19, 2014 01:51 PM UTC

The TreeView "create" event doesn't appear to fire either: ...ClientSideEvents(e => e.Create("tvCreated")...

Thanks,

Rick


RT Rick Thompson replied to Rick Thompson June 19, 2014 03:22 PM UTC

The TreeView "create" event doesn't appear to fire either: ...ClientSideEvents(e => e.Create("tvCreated")...

Thanks,

Rick

Please ignore the post regarding the create event not being called, it is being called. 

I had a typo - which I didn't see the first 100 times I looked :(

Thanks,

Rick


HP Harikrishnan P Syncfusion Team June 19, 2014 05:57 PM UTC

Hi Rick,

We regret for the inconvenience caused.

Query 1: is there way to prevent nodes from dropping "into" a child node? In other words I would like only a single level list and not necessarily a tree.

Query 2: Using IE I receive an error (“Error: Unable to get property 'nodeName' of undefined or null reference”)

Query 3: I have DropChild and DropSibling, yet I can drag and drop anywhere in the tree.

For query 1, yes we have option to prevent nodes from dropping into as a child node and we can achieve it by disabling the “dropChild” and “dropSibling” properties. But currently it is not working and we are facing issues with Drag and Drop options in treeview. The above reported issues are confirmed as a bug and we have logged defect reports for these issues.

Query: Is there any documentation that describes, for example, how to prevent dropping on a particular node?

Please find the API reference documentation for our JS components in the following link,

http://help.syncfusion.com/cr/js

Currently, we do not have inbuilt options to prevent dropping from particular node. This can be achieved only as a workaround solution by preventing the drop event for the required nodes.

Query: I would expect the check event to fire ONLY after the creation of the TreeView AND the user checks a checkbox.

We have analyzed this query (“the check event fires for every checked item during the creation of the TreeView.”) and confirmed this as a bug and logged a defect report for this.

The Fix for all the above reported issues will be available in our next service pack release which is expected to be rolled out at the end of next month. We will update this thread once these issue are fixed.

Please let us know if you have further queries

Regards,

HariKrishnan.



RT Rick Thompson June 19, 2014 05:59 PM UTC

Excellent, thanks for the update.


Rick



HP Harikrishnan P Syncfusion Team June 27, 2014 04:40 AM UTC

Hi Rick,

Thanks for the update. The fix for the reported issues will be available in our next service pack release for ASP.NET MVC. Our next service pack release is expected to be rolled out by the end of next month (July). Once it is rolled out we will update this thread.

Please get back to us if you would require any further assistance.

Regards

HariKrishnan.


Loader.
Live Chat Icon For mobile
Up arrow icon