Ver código fonte

修正事件延迟绑定

由于bootstrap的modal,在第二次打开的时候是一个全新的dom,所以此处一定要使用jquery延迟绑定,否则添加完一个项目之后,业务不刷新的情况下,保存按钮无效
fifsky 7 anos atrás
pai
commit
c69838d2c4
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      views/book/index.tpl

+ 2 - 2
views/book/index.tpl

@@ -375,7 +375,7 @@
         /**
          * 创建项目
          */
-        $("#btnSaveDocument").on("click",function () {
+        $("body").on("click","#btnSaveDocument",function () {
             var $this = $(this);
 
 
@@ -544,4 +544,4 @@
     });
 </script>
 </body>
-</html>
+</html>