Sfoglia il codice sorgente

修改主子表提交示例代码

RuoYi 4 anni fa
parent
commit
ffb2d2bc87

+ 9 - 10
ruoyi-admin/src/main/resources/templates/demo/table/subdata.html

@@ -164,14 +164,6 @@
             autoclose: true
         });
         
-        function bindDatetimepicker() {
-	        $("input[name$='date']").datetimepicker({
-	            format: "yyyy-mm-dd",
-	            minView: "month",
-	            autoclose: true,
-	            pickerPosition:'top-right'
-	        });
-        }
         
         function addColumn() {
         	var count = $("#" + table.options.id).bootstrapTable('getData').length;
@@ -188,9 +180,16 @@
                 	type: "",
                 }
         	});
-            
-        	bindDatetimepicker();
         }
+        
+        $("#bootstrap-table").on("post-body.bs.table", function (e, args) {
+        	$("input[name$='date']").datetimepicker({
+	            format: "yyyy-mm-dd",
+	            minView: "month",
+	            autoclose: true,
+	            pickerPosition:'top-right'
+	        });
+    	});
     </script>
 </body>
 </html>