ソースを参照

Support for arrays

Dennis Hernández 10 年 前
コミット
607bc0654c
1 ファイル変更6 行追加1 行削除
  1. 6 1
      src/extensions/flatJSON/bootstrap-table-flatJSON.js

+ 6 - 1
src/extensions/flatJSON/bootstrap-table-flatJSON.js

@@ -87,7 +87,12 @@
         },
 
         flatHelper: function (data) {
-            var flatArray = [];
+            var flatArray = [],
+				arrayHelper = [];
+			if (!$.isArray(data)) {
+				arrayHelper.push(data);
+				data = arrayHelper;
+			}
             $.each(data, function (i, element) {
                 flatArray.push(sd.flat(element));
             });