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

splitter.collapse usage

3 Answers 238 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Spammy
Top achievements
Rank 1
Spammy asked on 12 Oct 2011, 05:55 AM
Hello. I'm rather new to Javascript so please forgive the newbie question.  :-)

I have this snippet below:
<body>
    <div id="splitter" style="width: 75%; height: 600px">
        <div id="topPane">
            <p>top pane</p>
        </div>
        <div id="bottomPane">
            <p>left pane</p>
        </div>
    </div>
    <script>
        "use strict";
        $("#splitter").kendoSplitter({
            panes: [{
                min: "100px",
                max: "500px",
            }],
            collapsible: false,              
            orientation: "vertical"});
    </script>
</body>

Could someone educate me on how I would use the splitter.collapse syntax relative to my code above?

I've read that I can use splitter.collapse("topPane") to collapse my topPane, but I'm obviously missing something, as that line of code produces a bug in my Firebug console.

Clearly, how I'm calling the function is wrong.

Any help would be greatly appreciated.

Thank you.

Jay


3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 12 Oct 2011, 09:52 AM
Hello Jay,

The collapse method requires a DOM element, a jQuery object, or a CSS/jQuery selector as a parameter. You are supplying an ID string, which is neither of the above. Please consult our documentation and demos.

http://www.kendoui.com/documentation/ui-widgets/splitter/methods.aspx

http://demos.kendoui.com/splitter/api.html

For example, if you add a # sign in front of the ID, collapse will start working.

Greetings,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Spammy
Top achievements
Rank 1
answered on 12 Oct 2011, 05:06 PM
Hi Dimo.

Thanks for writing back.  I've actually tried variations of things that I thought would work, but none of them do. :-)

Are there any actual examples of the  collapse and expand methods?  I've been looking all over (even in the kendosplitter.js source) but wasn't able to find any snippets for those methods.

I'd just like to confirm that their behavior is what I assume them to be.. and of course, to get it to work.

Thanks,

Jay
0
Spammy
Top achievements
Rank 1
answered on 12 Oct 2011, 05:08 PM
<cough>

heh..

I realized that I had docked my browser window and that portions of your api.html page were not visible.

There I see the expand/collapse methods working (visually), so I'll see what I can grab from there.

Thanks again.

Jay
Tags
Splitter
Asked by
Spammy
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Spammy
Top achievements
Rank 1
Share this question
or