splitter.collapse usage

4 posts, 0 answers
  1. Spammy
    Spammy avatar
    3 posts
    Member since:
    Oct 2011

    Posted 12 Oct 2011 Link to this post

    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


  2. Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 12 Oct 2011 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Spammy
    Spammy avatar
    3 posts
    Member since:
    Oct 2011

    Posted 12 Oct 2011 Link to this post

    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
  5. Spammy
    Spammy avatar
    3 posts
    Member since:
    Oct 2011

    Posted 12 Oct 2011 Link to this post

    <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
Back to Top
Kendo UI is VS 2017 Ready