Toggleable button click event not fired

5 posts, 0 answers
  1. Peter
    Peter avatar
    35 posts
    Member since:
    May 2016

    Posted 08 Sep Link to this post

    Hi,

    the click event is not fired if the button is togleable:

    <body>
            <div id="example">
                <div class="demo-section k-content wide">
                    <div id="toolbar"></div>
                </div>
                <script>               
                    $(document).ready(function() {
                        $("#toolbar").kendoToolBar({
                            items: [
                                { type: "button", text: "Button",click: onclick  },
                                { type: "button", text: "Toggle Button", togglable: true, click: onclick  },
                              ]});
                    });
                   
                  function onclick(e) {
                    alert(e.target.context.innerText);
                  }
                </script>
            </div>
    </body>
    Dojo

    Is there an other event to catch the state changed?

    Peter

  2. Peter
    Peter avatar
    35 posts
    Member since:
    May 2016

    Posted 08 Sep in reply to Peter Link to this post

    excuse, it was only a typing error. correct:

    { type: "button", text: "Toggle Button", toggleable: true, click: onclick  },

  3. Kendo UI is VS 2017 Ready
  4. Peter
    Peter avatar
    35 posts
    Member since:
    May 2016

    Posted 08 Sep in reply to Peter Link to this post

    no. see http://demos.telerik.com/kendo-ui/toolbar/index

    togglable is correct. But then the click event is not fired.
  5. Peter
    Peter avatar
    35 posts
    Member since:
    May 2016

    Posted 08 Sep in reply to Peter Link to this post

    there is a toggle event:

    { type: "button", text: "Toggle Button", togglable: true, toggle: ontoggle  },

    now it works: Dojo
  6. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 10 Sep Link to this post

    Hello Peter,

     

    These findings are also documented here:

     

    As you can see, click corresponds only to command buttons. And toggle, to toggle buttons. The behavior experienced is normal and designed so based on the Kendo Toolbar specification. 

     

    Regards,
    Ianko
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
Back to Top
Kendo UI is VS 2017 Ready