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

Error in splitter.ajaxrequest

1 Answer 75 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Wade
Top achievements
Rank 1
Wade asked on 08 May 2012, 07:18 PM
I am using MVC 2012.1.214 controls.  I am trying to use the Splitter control with 2 panels.  The left panel displays a PanelBar control and the right panel is populated by the Select function of what is chosen in the panel bar. 

Here is the code that is invoked when an item in the panel bar is selected.
function Select(e) {
    //get the clicked item and its Url set as an HTML Attribute
    var item = $(e.item);
    var url = item.data("url");
    //get a reference to the splitter and load the corresponding content in the second pane
    splitter = $("#Splitter");
  
    if (splitter[0] && url) {
        splitter.data("tSplitter").ajaxRequest(splitter.find(".t-pane")[1], url);
    }
  
}

All works well as long as the url is correct that has been set on the data_url property of the menubar.  However I have also added authentication to the methods using the [Authorize(Roles="role1")].   If I am presented with a menu option that would cause me to hit a method I am not authorized for my cursor just sits there spinning.   So my question is is there a way to capture the exception processing when using ajaxRequest as noted above or is there an alternative way to achieve error handling? Below is an example of how jquery request handles the error processing however I am not sure how to handle that with ajaxRequest and the MVC library.
        $.ajax({
            url: url,
            success: function (data) {
                successcodehere
            },
            error: function (data) {
                errorcodehere
            }
        });

1 Answer, 1 is accepted

Sort by
0
MikeWiese
Top achievements
Rank 1
answered on 12 Apr 2013, 03:10 AM
Can't believe that Telerik hasn't fixed this yet. Or even responded to this post.

Telerik guys, it's now April 2013. How can we catch a failed ajaxRequest, and give our users something better than a spinning 'wait' icon?
Tags
Splitter
Asked by
Wade
Top achievements
Rank 1
Answers by
MikeWiese
Top achievements
Rank 1
Share this question
or