Problem with AjaxRequest (probably)

2 posts, 0 answers
  1. Andy
    Andy avatar
    2 posts
    Member since:
    Jan 2017

    Posted 28 Feb Link to this post

    I have a splitter with two windows, left holds a treeview, the right a partial view that depends on the selected node in the treeview to select the content (via an onSelect event).

    The problem is that this code sometimes works perfectly and sometimes does not - specifically it renders the "parent" page (including the splitter, treeview etc) inside the right hand pane.

    I'm a newbie with MVC, javascript etc so have no idea where the problem is - nor can I reproduce it at will.

    The javascript snippit is:

    function onSelect(e) {
            try {
                var treeView = e.sender;
                var text = treeView.text(e.node);
                var data = treeView.dataItem(e.node);
                var id = data.id;
                console.log(id, text);
                var parent = null;
                try {
                   parent = treeView.text(e.node.parentNode);
                } catch (e) {
                    console.log(e.message);
                }
                
                $("#splitter").kendoSplitter();
                var splitter = $("#splitter").data("kendoSplitter");

                switch (text) {
                    case "Case":
                        splitter.ajaxRequest("#right-pane", "PartialCase", { id: id });
                        break;

     

    And using the F12 debug I can follow it to the "splitter.ajaxRequest" line at which point it populates the right window with the parent page.

     

    I hope this is something stupid.

     

    Thanks

  2. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    621 posts

    Posted 02 Mar Link to this post

    Hi Andy,

    The following line:
    $("#splitter").kendoSplitter();

    would initialize a new instance of Kendo Splitter on top of the already initialized one. This would cause a number of issues, including problems similar to the observed. Therefor, I would recommend you to remove that line from your implementation and test again.

    Regards,
    Veselin Tsvetanov
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top