Browse Source

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

zhixin 7 years ago
parent
commit
075ca3da1f
2 changed files with 4 additions and 3 deletions
  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
 
 - 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 #3696, can't search data with formatter
+- fix(js): fix #2485, selections bugs
 - 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(css): fix #1848, remove toolbar line-height
 - 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
           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]
         } else {
           continue