Several buttons using snap clicks, only one is connected to the network

In the context ko foreach: widgits I create a list of items with just a few buttons, which display settings to the user.

 <ul> <!-- ko foreach: wigits --> <li> <span data-bind="text: $data.text"></span> <button id="fast" data-bind="click: function(){$root.spinWidget($data, '1000rpm')}"></button> <button id="medium" data-bind="click: function(){$root.spinWidget($data, '500rpm')}"></button> <button id="slow" data-bind="click: function(){$root.spinWidget($data, '200rpm')}"></button> </li> <!-- /ko --> </ul> > <ul> <!-- ko foreach: wigits --> <li> <span data-bind="text: $data.text"></span> <button id="fast" data-bind="click: function(){$root.spinWidget($data, '1000rpm')}"></button> <button id="medium" data-bind="click: function(){$root.spinWidget($data, '500rpm')}"></button> <button id="slow" data-bind="click: function(){$root.spinWidget($data, '200rpm')}"></button> </li> <!-- /ko --> </ul> -bind = "click: function () {$ root.spinWidget ($ data, '500rpm')}"> </ button> <ul> <!-- ko foreach: wigits --> <li> <span data-bind="text: $data.text"></span> <button id="fast" data-bind="click: function(){$root.spinWidget($data, '1000rpm')}"></button> <button id="medium" data-bind="click: function(){$root.spinWidget($data, '500rpm')}"></button> <button id="slow" data-bind="click: function(){$root.spinWidget($data, '200rpm')}"></button> </li> <!-- /ko --> </ul> -bind = "click: function () {$ root.spinWidget ($ data, '200rpm')}"> </ button> <ul> <!-- ko foreach: wigits --> <li> <span data-bind="text: $data.text"></span> <button id="fast" data-bind="click: function(){$root.spinWidget($data, '1000rpm')}"></button> <button id="medium" data-bind="click: function(){$root.spinWidget($data, '500rpm')}"></button> <button id="slow" data-bind="click: function(){$root.spinWidget($data, '200rpm')}"></button> </li> <!-- /ko --> </ul> 

When I click the first button, I see that every click is invoked by the click handler. When I click or check other buttons, I see that the click handler is not installed.

+4
source share
1 answer

issue over the fact that I included knockoutjs below the jquery, as soon as I moved it up, it works. idk why but it does.

0
source

All Articles