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

Problem with AjaxRequest (probably)

1 Answer 74 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 28 Feb 2017, 12:38 PM

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

1 Answer, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 02 Mar 2017, 08:39 AM
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.
Tags
Splitter
Asked by
Andy
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Share this question
or