javascript popup不会弹出,因为绑定已分配

时间:2019-11-24 23:44:27

标签: javascript jquery knockout-3.0

c#'/ Clients / ClientSelectDataTable'被调用并返回。

      self.LookupClient = function () {
          $.ajax({
              type: 'POST',
              url: '/Clients/ClientSelectDataTable'
          }).done(function (msg) {
              //grab the partial from the controller
              $("#SelectClient").html('');
              $("#SelectClient").html(msg);
              //initialize the js
              theClientPicker = new ClientSelectModel('ClientSelectDataTable', '/API/GetAllClients', AssignClient, self.CancelClientSelect, "Select");
              ko.applyBindings(theClientPicker, $("#SelectClient")[0]);

              $.fancybox("#SelectClient", { //launch ClientSelect widget
                  modal: true,
                  afterClose: function () {
                      theClientPicker.Dispose();
                      ko.cleanNode($("#SelectClient")[0]);
                  }
              });
          });
      }

在这里抛出异常      ko.applyBindings(theClientPicker,$(“#SelectClient”)[0]);

...

    if (!sourceBindings) {
        if (alreadyBound) {
            throw Error("You cannot apply bindings multiple times to the same element.");

我可以捕获到异常,但是由于未分配按钮上的事件,所以弹出窗口不起作用。

这是一个新的theClientPicker,所以我看不到如何分配它。

1 个答案:

答案 0 :(得分:1)

发现了问题。
这是3.4.2和3.5.0之间引入的缺陷或重大缺陷。
恢复并冻结3.4.2可以修复它。

是否有适当的方式来举报?