ソースを参照

Merge pull request #5888 from wenzhixin/fix/5681

fix/5681
文翼 4 年 前
コミット
f7dea6b5ed

+ 1 - 1
src/bootstrap-table.js

@@ -2569,7 +2569,7 @@ class BootstrapTable {
         id = id.toString()
       } else if (typeof rowUniqueId === 'number') {
         if ((Number(rowUniqueId) === rowUniqueId) && (rowUniqueId % 1 === 0)) {
-          id = parseInt(id)
+          id = parseInt(id, 10)
         } else if ((rowUniqueId === Number(rowUniqueId)) && (rowUniqueId !== 0)) {
           id = parseFloat(id)
         }

+ 1 - 1
src/extensions/pipeline/bootstrap-table-pipeline.js

@@ -105,7 +105,7 @@ BootstrapTable.prototype.onSort = function () {
 BootstrapTable.prototype.onPageListChange = function (event) {
   /* rebuild cache window on page size change */
   const target = $(event.currentTarget)
-  const newPageSize = parseInt(target.text())
+  const newPageSize = parseInt(target.text(), 10)
 
   this.options.pipelineSize = this.calculatePipelineSize(this.options.pipelineSize, newPageSize)
   this.resetCache = true

+ 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 = parseInt(item[this.options.parentIdField], 10)
+
       if (
-        this.options.rootParentId === item[this.options.parentIdField] ||
-        !item[this.options.parentIdField]
+        this.options.rootParentId === parentId ||
+        !parentId
       ) {
         if (item._level === undefined) {
           item._level = 0