Browse Source

Merge pull request #6562 from wenzhixin/fix/6550

Fixed treegrid not working when id is text
文翼 3 years ago
parent
commit
05cf6dc2da
2 changed files with 12 additions and 4 deletions
  1. 10 0
      CHANGELOG.md
  2. 2 4
      src/extensions/treegrid/bootstrap-table-treegrid.js

+ 10 - 0
CHANGELOG.md

@@ -1,6 +1,16 @@
 ChangeLog
 ---------
 
+### 1.21.3
+
+- **Update:** Updated extend util instead of `$.extend`.
+- **Update:** - Fixed overwriting the `filterOptions` after rebuild.
+
+#### Extensions
+
+- **Update(export):** Fixed `exportTypes` option not working bug.
+- **Update(treegrid):** Fixed treegrid not working when id is text.
+
 ### 1.21.2
 
 #### Core

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

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