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

Toggleable button click event not fired

4 Answers 557 Views
Button
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 08 Sep 2016, 02:29 PM

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

4 Answers, 1 is accepted

Sort by
0
Peter
Top achievements
Rank 1
answered on 08 Sep 2016, 02:33 PM

excuse, it was only a typing error. correct:

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

0
Peter
Top achievements
Rank 1
answered on 08 Sep 2016, 02:44 PM

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

togglable is correct. But then the click event is not fired.
0
Peter
Top achievements
Rank 1
answered on 08 Sep 2016, 03:59 PM

there is a toggle event:

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

now it works: Dojo
0
Ianko
Telerik team
answered on 10 Sep 2016, 06:54 AM

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.
 
Tags
Button
Asked by
Peter
Top achievements
Rank 1
Answers by
Peter
Top achievements
Rank 1
Ianko
Telerik team
Share this question
or