Browse Source

Parse int to prevent type missmatch

Dustin Utecht 4 years ago
parent
commit
68e8833284
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/extensions/treegrid/bootstrap-table-treegrid.js

+ 4 - 2
src/extensions/treegrid/bootstrap-table-treegrid.js

@@ -75,9 +75,11 @@ $.BootstrapTable = class extends $.BootstrapTable {
 
   initRow (item, idx, data, parentDom) {
     if (this.treeEnable) {
+      const parentId = Number.parseInt(item[this.options.parentIdField])
+
       if (
-        this.options.rootParentId === item[this.options.parentIdField] ||
-        !item[this.options.parentIdField]
+        this.options.rootParentId === parentId ||
+        !parentId
       ) {
         if (item._level === undefined) {
           item._level = 0