This is a migrated thread and some comments may be shown as answers.

[Solved] Invalid response during node expand causes script error

0 Answers 12 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Valdas
Top achievements
Rank 1
Valdas asked on 08 Aug 2012, 06:36 AM
Hi,
I have encoutered an script error in telerik.treeview.*.js when I try to expand a treeview node when my session timeouts (response is HTML with login screen). I have a OnError event handler in place with parseerror handling but the error handler is not hiting. OnError handler looks like this:
function OnAjaxError(e)
{
    if (e.textStatus == "parsererror")
    {
        window.location = window.location;
 
        e.preventDefault();
    }
}

My treeview:
@(Html.Telerik()
    .TreeView()
    .Name("Foo")
    .DragAndDrop(dragAndDrop =>
        {
            dragAndDrop.Enabled(true)
                .DropTargets("#SelectedNodes");
        })        
    .ClientEvents(events =>
        {
            events.OnNodeDrop("OnNodeDrop");
            events.OnDataBound("OnDataBound");
            events.OnError("OnAjaxError");
        })
    .DataBinding(binding =>
        binding.Ajax()
            .Select("Get", "Controller")))

Is this a bug in component or I'm handling it in incorrect way?
Tags
TreeView
Asked by
Valdas
Top achievements
Rank 1
Share this question
or