Browse Source

Merge branch 'develop' into fix/4627

Dustin Utecht 6 years ago
parent
commit
bab9a64ea0

+ 5 - 1
src/extensions/group-by-v2/bootstrap-table-group-by.js

@@ -55,7 +55,11 @@ BootstrapTable.prototype.initSort = function (...args) {
   if ((this.options.groupBy) && (this.options.groupByField !== '')) {
 
     if ((this.options.sortName !== this.options.groupByField)) {
-      this.data.sort((a, b) => a[that.options.groupByField].localeCompare(b[that.options.groupByField]))
+      this.data.sort((a, b) => {
+        a = a[that.options.groupByField].toString()
+        b = b[that.options.groupByField].toString()
+        return a.localeCompare(b, undefined, { numeric: true })
+      })
     }
 
     const groups = groupBy(that.data, item => [item[that.options.groupByField]])

+ 5 - 5
src/extensions/print/bootstrap-table-print.js

@@ -99,11 +99,11 @@ $.BootstrapTable = class extends $.BootstrapTable {
 
   doPrint (data) {
     const formatValue = (row, i, column ) => {
-      const value = row[column.field]
-      if (typeof column.printFormatter === 'function') {
-        return column.printFormatter(...[value, row, i])
-      }
-      return typeof value === 'undefined' ? '-' : value
+      const value = Utils.calculateObjectValue(column, column.printFormatter,
+        [row[column.field], row, i], row[column.field])
+
+      return typeof value === 'undefined' || value === null
+        ? this.options.undefinedText : value
     }
 
     const buildTable = (data, columnsArray) => {

+ 3 - 1
src/extensions/treegrid/bootstrap-table-treegrid.js

@@ -32,7 +32,9 @@ $.BootstrapTable = class extends $.BootstrapTable {
   }
 
   initBody (...args) {
-    this.options.virtualScroll = !this.treeEnable
+    if (this.treeEnable) {
+      this.options.virtualScroll = false
+    }
     super.initBody(...args)
   }