浏览代码

fix(js): fix #4081, getRowByUniqueId error when row unique id is undefined

zhixin 7 年之前
父节点
当前提交
075ca3da1f
共有 2 个文件被更改,包括 4 次插入3 次删除
  1. 3 2
      CHANGELOG.md
  2. 1 1
      src/bootstrap-table.js

+ 3 - 2
CHANGELOG.md

@@ -17,10 +17,11 @@ ChangeLog
 - feat(addrbar extension): add addrbar extension
 - feat(addrbar extension): add addrbar extension
 
 
 - fix(js): fix #1769, improve check/uncheck methods
 - fix(js): fix #1769, improve check/uncheck methods
-- fix(js): fix #2485, selections bugs
 - fix(js): fix #1983, cookie with pageNumber and searchText bug
 - fix(js): fix #1983, cookie with pageNumber and searchText bug
-- fix(js): fix #3696, can't search data with formatter
+- fix(js): fix #2485, selections bugs
 - fix(js): fix #2545, customSearch support data attribute
 - fix(js): fix #2545, customSearch support data attribute
+- fix(js): fix #3696, can't search data with formatter
+- fix(js): fix #4081, getRowByUniqueId error when row unique id is undefined
 - fix(js): fix older bootstrap version bug
 - fix(js): fix older bootstrap version bug
 - fix(css): fix #1848, remove toolbar line-height
 - fix(css): fix #1848, remove toolbar line-height
 - fix(css): limit fullscreen CSS rule scope
 - fix(css): limit fullscreen CSS rule scope

+ 1 - 1
src/bootstrap-table.js

@@ -2524,7 +2524,7 @@
 
 
         if (row.hasOwnProperty(uniqueId)) { // uniqueId is a column
         if (row.hasOwnProperty(uniqueId)) { // uniqueId is a column
           rowUniqueId = row[uniqueId]
           rowUniqueId = row[uniqueId]
-        } else if (row._data.hasOwnProperty(uniqueId)) { // uniqueId is a row data property
+        } else if (row._data && row._data.hasOwnProperty(uniqueId)) { // uniqueId is a row data property
           rowUniqueId = row._data[uniqueId]
           rowUniqueId = row._data[uniqueId]
         } else {
         } else {
           continue
           continue