Cannot read properties of null (reading '0') Kendo UI Splitter

137 Views Asked by At

I am running into an error with Kendo UI Splitter, Cannot read properties of null (reading '0'), I have no idea why this is happening and can only provide a bit of code for it. Here is the code

switch (collapseType) {
    case "top": {
        splitter.expand("#bottom-pane");
        splitter.collapse("#top-pane");
        splitter.size("#top-pane", "0%");
        splitterPosition = "top";
    } break;

    case "bottom": {
        splitter.expand("#top-pane");
        splitter.collapse("#bottom-pane");
        splitter.size("#bottom-pane", "0");
        splitterPosition = "bottom";
    } break;

    default: {
        splitter.expand("#bottom-pane");
        splitter.expand("#top-pane");
        splitter.size("#bottom-pane", "50%");
        splitter.size("#top-pane", "48.25%");
        $('#right-pane').css('top', '0px');
        splitterPosition = "middle";
    } break;
}

and its blowing up in the default, at the splitter.expand("#bottom-pane");

the error that I am getting is Error

Has anyone ran into the error or know what the issue is?

Thanks

1

There are 1 best solutions below

2
On

The size method expects a pane and a value as parameters. The value of the new size of the pane should be defined as pixels (i.e. "200px") or as a percentage (i.e. "50%"), so I would guess that splitter.size("#bottom-pane", "0"); is causing the issue.

splitter.size("#bottom-pane", "0px"); should resolve it.