浏览代码

Merge pull request #1597 from wenzhixin/develop

Update to 1.9.1
文翼 10 年之前
父节点
当前提交
c7aa683eaf

+ 18 - 0
CHANGELOG.md

@@ -1,5 +1,23 @@
 ## ChangeLog
 
+### 1.9.1
+
+- [bug] Removed no records events.
+- [bug] Fixed cardView fieldIndex error.
+- [bug] Fixed #1130: table-condensed is not working.
+- [bug] Fixed #1482: export all server sidePagination bug(export extension).
+- [bug] Fixed #1248: IE8 does not support indexOf function.
+- [bug] Fixed #1491: (un)check event element argument missing.
+- [bug] Fixed Italian translation.
+- [bug] Unified naming of MS in type names(export extension).
+- [bug] Fixed selectPage method fails(cookie extension).
+- [bug] Add ja-JP and ms-MY translation for formatAllRows.
+- [enh] UniqueId can also be stored in a row's data property.
+- [enh] Use default settings when cookie settings don't exist(cookie extension).
+- [enh] Expand `filterBy` to accept and array of values.
+- [enh] Added `updateByUniqueId` method.
+- [doc] Added `iconSize` docs.
+
 ### 1.9.0
 
 - [enh] Update bootstrap-table-cookie.js.

+ 15 - 0
DONATORS.md

@@ -15,3 +15,18 @@
 * Nicolas Pascual - $10
 * Hassan Ejaz - $10
 * Frank Hines - $100
+* Luis Triana Vega - $10
+* PROMOTUX DI FRANCESCO MELONI E C. S.N.C. - $15
+* Emmanuel Kielichowski - $15
+
+## 支付宝
+
+* 萃华:10.18元
+* 小马哥:5元
+* 振:20元
+* 懒虫:8.8元
+* rainc:50元
+
+## 微信
+
+* 笑:50元

+ 5 - 0
docs/_i18n/en/documentation/localizations.md

@@ -32,6 +32,11 @@
         <td>'Showing %s to %s of %s rows'</td>
     </tr>
     <tr>
+        <td>formatDetailPagination</td>
+        <td>totalRows</td>
+        <td>'Showing %s rows'</td>
+    </tr>
+    <tr>
         <td>formatSearch</td>
         <td>-</td>
         <td>'Search'</td>

+ 15 - 5
docs/_i18n/en/documentation/methods.md

@@ -15,6 +15,9 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter);`.
         <th>Name</th>
         <th>Parameter</th>
         <th>Description</th>
+        <th data-formatter="methodFormatter"
+            data-align="center"
+            data-valign="middle">Example</th>
     </tr>
     </thead>
     <tbody>
@@ -45,9 +48,7 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter);`.
     <tr>
         <td>getRowByUniqueId</td>
         <td>id</td>
-        <td>
-        Get data from table, the row that contains the id passed by parameter.
-        </td>
+        <td>Get data from table, the row that contains the id passed by parameter.</td>
         <td>getRowByUniqueId</td>
     </tr>
     <tr>
@@ -75,8 +76,8 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter);`.
         Remove data from table, the params contains two properties: <br>
         field: the field name of remove rows. <br>
         values: the array of values for rows which should be removed.
-        <td>remove</td>
         </td>
+        <td>remove</td>
     </tr>
     <tr>
         <td>removeAll</td>
@@ -112,6 +113,15 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter);`.
         row: the new row data.
         </td>
     </tr>
+    <tr>
+        <td>updateByUniqueId</td>
+        <td>params</td>
+        <td>
+        Update the specified row, the param contains following properties: <br>
+        id: a row id where the id should be the uniqueid field assigned to the table. <br>
+        row: the new row data.
+        </td>
+    </tr>
 	<tr>
         <td>showRow</td>
         <td>params</td>
@@ -258,7 +268,7 @@ The calling method syntax: `$('#table').bootstrapTable('method', parameter);`.
     <tr>
         <td>filterBy</td>
         <td>params</td>
-        <td>(Can use only in client-side)Filter data in table, eg. you can filter <code>{age: 10}</code> to show the data only age is equal to 10.</td>
+        <td>(Can use only in client-side) Filter data in table, e.g. you can filter <code>{age: 10}</code> to show the data only age is equal to 10.  You can also filter with an array of values, as in: <code>{age: 10, hairColor: ["blue", "red", "green"]} to find data where age is equal to 10 and hairColor is either blue, red, or green.</td>
     </tr>
     <tr>
         <td>selectPage</td>

+ 14 - 0
docs/_i18n/en/documentation/table-options.md

@@ -76,6 +76,13 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
         <td>'glyphicon'</td>
         <td>Defines icon set name ('glyphicon' or 'fa' for FontAwesome). By default 'glyphicon' is used. </td>
     </tr>
+     <tr>
+        <td>iconSize</td>
+        <td>data-icon-size</td>
+        <td>String</td>
+        <td>undefined</td>
+        <td>Defines icon size: <ul><li>undefined => btn</li><li>xs => btn-xs</li><li>sm => btn-sm</li><li>lg => btn-lg</li></ul>
+    </tr>    
     <tr>
         <td>icons</td>
         <td>data-icons</td>
@@ -210,6 +217,13 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
         <td>True to show a pagination toolbar on table bottom.</td>
     </tr>
     <tr>
+        <td>onlyInfoPagination</td>
+        <td>data-only-info-pagination</td>
+        <td>Boolean</td>
+        <td>false</td>
+        <td>True to show only the quantity of the data that is showing in the table. It needs the pagination table options is set to true.</td>
+    </tr>
+    <tr>
         <td>sidePagination</td>
         <td>data-side-pagination</td>
         <td>String</td>

+ 5 - 0
docs/_i18n/es/documentation/localizations.md

@@ -32,6 +32,11 @@
         <td>'Showing %s to %s of %s rows'</td>
     </tr>
     <tr>
+        <td>formatDetailPagination</td>
+        <td>totalRows</td>
+        <td>'Showing %s rows'</td>
+    </tr>
+    <tr>
         <td>formatSearch</td>
         <td>-</td>
         <td>'Search'</td>

+ 7 - 0
docs/_i18n/es/documentation/table-options.md

@@ -182,6 +182,13 @@ Las opciones de la tabla están definidas en `jQuery.fn.bootstrapTable.defaults`
         <td>True para mostrar la paginación al final de la tabla.</td>
     </tr>
     <tr>
+        <td>onlyInfoPagination</td>
+        <td>data-only-info-pagination</td>
+        <td>Boolean</td>
+        <td>false</td>
+        <td>True para mostrar solo la cantidad de los registros que se están mostrando en la tabla. Esta opción necesita que la opción pagination este en true.</td>
+    </tr>
+    <tr>
         <td>sidePagination</td>
         <td>data-side-pagination</td>
         <td>String</td>

+ 7 - 0
docs/_i18n/es/extensions/filter-control.md

@@ -24,6 +24,13 @@ Dependence if you use the datepicker option: [bootstrap-datepicker](https://gith
 * default: `false`
 
 
+### filterStrictSearch
+
+* type: Boolean
+* description: Set true to enable the strict search in column.
+* default: `false`
+
+
 ## Column options
 
 ### filterControl

+ 5 - 0
docs/_i18n/zh-cn/documentation/localizations.md

@@ -32,6 +32,11 @@
         <td>'Showing %s to %s of %s rows'</td>
     </tr>
     <tr>
+        <td>formatDetailPagination</td>
+        <td>totalRows</td>
+        <td>'Showing %s rows'</td>
+    </tr>
+    <tr>
         <td>formatSearch</td>
         <td>-</td>
         <td>'Search'</td>

+ 7 - 0
docs/_i18n/zh-cn/documentation/table-options.md

@@ -190,6 +190,13 @@
         <td>True to show a pagination toolbar on table bottom.</td>
     </tr>
     <tr>
+        <td>onlyInfoPagination</td>
+        <td>data-only-info-pagination</td>
+        <td>Boolean</td>
+        <td>false</td>
+        <td>True to show only the quantity of the data that is showing in the table. It needs the pagination table options is set to true.</td>
+    </tr>
+    <tr>
         <td>sidePagination</td>
         <td>data-side-pagination</td>
         <td>String</td>

+ 7 - 0
docs/_i18n/zh-cn/extensions/filter-control.md

@@ -24,6 +24,13 @@ Dependence if you use the datepicker option: [bootstrap-datepicker](https://gith
 * default: `false`
 
 
+### filterStrictSearch
+
+* type: Boolean
+* description: Set true to enable the strict search in column.
+* default: `false`
+
+
 ## Column options
 
 ### filterControl

+ 3 - 0
docs/_includes/nav.html

@@ -31,6 +31,9 @@
                     <a href="{{ site.baseurl }}/faq/">{% t pages.faq.title %}</a>
                 </li>
                 <li>
+                    <a href="http://stackoverflow.com/questions/tagged/bootstrap-table" target="_blank">Questions / Helps</a>
+                </li>
+                <li>
                     <a href="{{ site.repo }}" target="_blank">GitHub</a>
                 </li>
             </ul>

二进制
docs/assets/images/weixin.png


二进制
docs/assets/images/weixinLogo.png


+ 46 - 6
docs/donate.md

@@ -8,15 +8,35 @@ lead: pages.donate.lead
 {% tf donate.md %}
 
 <div class="row">
-    <div class="col-md-6">
-        <div class="tc">
-            <img src="../assets/images/alipayLogo.png">
+    <div class="col-md-8">
+        <div class="col-md-6">
+            <div class="tc">
+                <img src="../assets/images/alipayLogo.png">
+            </div>
+            <div class="tc">
+                <img src="../assets/images/alipay.jpg">
+            </div>
+            <ul style="margin-top: 20px">
+            <li>萃华:10.18元</li>
+            <li>小马哥:5元</li>
+            <li>振:20元</li>
+            <li>懒虫:8.8元</li>
+            <li>rainc:50元</li>
+            </ul>
         </div>
-        <div class="tc">
-            <img src="../assets/images/alipay.jpg">
+        <div class="col-md-6">
+            <div class="tc">
+                <img src="../assets/images/weixinLogo.png">
+            </div>
+            <div class="tc">
+                <img src="../assets/images/weixin.png">
+            </div>
+            <ul style="margin-top: 20px">
+            <li>笑:50元</li>
+            </ul>
         </div>
     </div>
-    <div class="col-md-6">
+    <div class="col-md-4">
         <div class="tc">
             <img src="../assets/images/paypalLogo.png">
         </div>
@@ -25,5 +45,25 @@ lead: pages.donate.lead
                 <img src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif">
             </a>
         </div>
+        <ul style="margin-top: 20px">
+        <li>Richard C Jordan - $35</li>
+        <li>Janet Moery - $5</li>
+        <li>Rene Halskov - $10</li>
+        <li>Angel Arambula Garcia - $5</li>
+        <li>David Graham - $5</li>
+        <li>Paul Abbott - $20</li>
+        <li>Philip Tepfer - $10</li>
+        <li>Marcus Eddy - $5</li>
+        <li>Keith Rockhold - $50</li>
+        <li>Ramon Sosa Diaz - $10</li>
+        <li>Goncalo Cordeiro - $25</li>
+        <li>Marzena Wspanialy - $10</li>
+        <li>Nicolas Pascual - $10</li>
+        <li>Hassan Ejaz - $10</li>
+        <li>Frank Hines - $100</li>
+        <li>Luis Triana Vega - $10</li>
+        <li>PROMOTUX DI FRANCESCO MELONI E C. S.N.C. - $15</li>
+        <li>Emmanuel Kielichowski - $15</li>
+        </ul>
     </div>
 </div>

+ 7 - 7
src/bootstrap-table.css

@@ -11,12 +11,12 @@
     border-radius: 1px;
 }
 
-.bootstrap-table .table,
-.bootstrap-table .table > tbody > tr > th,
-.bootstrap-table .table > tfoot > tr > th,
-.bootstrap-table .table > thead > tr > td,
-.bootstrap-table .table > tbody > tr > td,
-.bootstrap-table .table > tfoot > tr > td {
+.bootstrap-table .table:not(.table-condensed),
+.bootstrap-table .table:not(.table-condensed) > tbody > tr > th,
+.bootstrap-table .table:not(.table-condensed) > tfoot > tr > th,
+.bootstrap-table .table:not(.table-condensed) > thead > tr > td,
+.bootstrap-table .table:not(.table-condensed) > tbody > tr > td,
+.bootstrap-table .table:not(.table-condensed) > tfoot > tr > td {
     padding: 8px !important;
 }
 
@@ -294,4 +294,4 @@ div.fixed-table-scroll-outer {
     width: 200px;
     height: 150px;
     overflow: hidden;
-}
+}

+ 164 - 119
src/bootstrap-table.js

@@ -263,6 +263,7 @@
             return res;
         },
         pagination: false,
+        onlyInfoPagination: false,
         sidePagination: 'client', // client or server
         totalRows: 0, // server side need to set
         pageNumber: 1,
@@ -415,6 +416,9 @@
         formatShowingRows: function (pageFrom, pageTo, totalRows) {
             return sprintf('Showing %s to %s of %s rows', pageFrom, pageTo, totalRows);
         },
+        formatDetailPagination: function (totalRows) {
+            return sprintf('Showing %s rows', totalRows);
+        },
         formatSearch: function () {
             return 'Search';
         },
@@ -790,6 +794,7 @@
             .on('click', '[name="btSelectAll"]', function () {
                 var checked = $(this).prop('checked');
                 that[checked ? 'checkAll' : 'uncheckAll']();
+                that.updateSelected();
             });
     };
 
@@ -945,14 +950,18 @@
         }
 
         if (this.options.showRefresh) {
-            html.push(sprintf('<button class="btn btn-default' + (this.options.iconSize === undefined ? '' : ' btn-' + this.options.iconSize) + '" type="button" name="refresh" title="%s">',
+            html.push(sprintf('<button class="btn btn-default' +
+                    sprintf(' btn-%s', this.options.iconSize) +
+                    '" type="button" name="refresh" title="%s">',
                     this.options.formatRefresh()),
                 sprintf('<i class="%s %s"></i>', this.options.iconsPrefix, this.options.icons.refresh),
                 '</button>');
         }
 
         if (this.options.showToggle) {
-            html.push(sprintf('<button class="btn btn-default' + (this.options.iconSize === undefined ? '' : ' btn-' + this.options.iconSize) + '" type="button" name="toggle" title="%s">',
+            html.push(sprintf('<button class="btn btn-default' +
+                    sprintf(' btn-%s', this.options.iconSize) +
+                    '" type="button" name="toggle" title="%s">',
                     this.options.formatToggle()),
                 sprintf('<i class="%s %s"></i>', this.options.iconsPrefix, this.options.icons.toggle),
                 '</button>');
@@ -961,7 +970,9 @@
         if (this.options.showColumns) {
             html.push(sprintf('<div class="keep-open btn-group" title="%s">',
                     this.options.formatColumns()),
-                '<button type="button" class="btn btn-default' + (this.options.iconSize == undefined ? '' : ' btn-' + this.options.iconSize) + ' dropdown-toggle" data-toggle="dropdown">',
+                '<button type="button" class="btn btn-default' +
+                sprintf(' btn-%s', this.options.iconSize) +
+                ' dropdown-toggle" data-toggle="dropdown">',
                 sprintf('<i class="%s %s"></i>', this.options.iconsPrefix, this.options.icons.columns),
                 ' <span class="caret"></span>',
                 '</button>',
@@ -1036,7 +1047,9 @@
             html = [];
             html.push(
                 '<div class="pull-' + this.options.searchAlign + ' search">',
-                sprintf('<input class="form-control' + (this.options.iconSize === undefined ? '' : ' input-' + this.options.iconSize) + '" type="text" placeholder="%s">',
+                sprintf('<input class="form-control' +
+                    sprintf(' input-%s', this.options.iconSize) +
+                    '" type="text" placeholder="%s">',
                     this.options.formatSearch()),
                 '</div>');
 
@@ -1080,7 +1093,11 @@
             // Check filter
             this.data = f ? $.grep(this.options.data, function (item, i) {
                 for (var key in f) {
-                    if (item[key] !== f[key]) {
+                    if ($.isArray(f[key])) {
+                        if ($.inArray(item[key], f[key]) === -1) {
+                            return false;
+                        }
+                    } else if (item[key] !== f[key]) {
                         return false;
                     }
                 }
@@ -1151,7 +1168,7 @@
                 var pageLst = typeof this.options.pageList === 'string' ?
                     this.options.pageList.replace('[', '').replace(']', '')
                         .replace(/ /g, '').toLowerCase().split(',') : this.options.pageList;
-                if (pageLst.indexOf(this.options.formatAllRows().toLowerCase()) > -1) {
+                if ($.inArray(this.options.formatAllRows().toLowerCase(), pageLst)  > -1) {
                     $allSelected = true;
                 }
             }
@@ -1173,124 +1190,129 @@
         html.push(
             '<div class="pull-' + this.options.paginationDetailHAlign + ' pagination-detail">',
             '<span class="pagination-info">',
+            this.options.onlyInfoPagination ? this.options.formatDetailPagination(this.options.totalRows) :
             this.options.formatShowingRows(this.pageFrom, this.pageTo, this.options.totalRows),
             '</span>');
 
-        html.push('<span class="page-list">');
-
-        var pageNumber = [
-                sprintf('<span class="btn-group %s">',
-                    this.options.paginationVAlign === 'top' || this.options.paginationVAlign === 'both' ?
-                        'dropdown' : 'dropup'),
-                '<button type="button" class="btn btn-default ' +
-                (this.options.iconSize === undefined ? '' : ' btn-' + this.options.iconSize) +
-                ' dropdown-toggle" data-toggle="dropdown">',
-                '<span class="page-size">',
-                $allSelected ? this.options.formatAllRows() : this.options.pageSize,
-                '</span>',
-                ' <span class="caret"></span>',
-                '</button>',
-                '<ul class="dropdown-menu" role="menu">'
-            ],
-            pageList = this.options.pageList;
-
-        if (typeof this.options.pageList === 'string') {
-            var list = this.options.pageList.replace('[', '').replace(']', '')
-                .replace(/ /g, '').split(',');
-
-            pageList = [];
-            $.each(list, function (i, value) {
-                pageList.push(value.toUpperCase() === that.options.formatAllRows().toUpperCase() ?
-                    that.options.formatAllRows() : +value);
-            });
-        }
+        if (!this.options.onlyInfoPagination) {
+            html.push('<span class="page-list">');
+
+            var pageNumber = [
+                    sprintf('<span class="btn-group %s">',
+                        this.options.paginationVAlign === 'top' || this.options.paginationVAlign === 'both' ?
+                            'dropdown' : 'dropup'),
+                    '<button type="button" class="btn btn-default ' +
+                    sprintf(' btn-%s', this.options.iconSize) +
+                    ' dropdown-toggle" data-toggle="dropdown">',
+                    '<span class="page-size">',
+                    $allSelected ? this.options.formatAllRows() : this.options.pageSize,
+                    '</span>',
+                    ' <span class="caret"></span>',
+                    '</button>',
+                    '<ul class="dropdown-menu" role="menu">'
+                ],
+                pageList = this.options.pageList;
+
+            if (typeof this.options.pageList === 'string') {
+                var list = this.options.pageList.replace('[', '').replace(']', '')
+                    .replace(/ /g, '').split(',');
+
+                pageList = [];
+                $.each(list, function (i, value) {
+                    pageList.push(value.toUpperCase() === that.options.formatAllRows().toUpperCase() ?
+                        that.options.formatAllRows() : +value);
+                });
+            }
 
-        $.each(pageList, function (i, page) {
-            if (!that.options.smartDisplay || i === 0 || pageList[i - 1] <= that.options.totalRows) {
-                var active;
-                if ($allSelected) {
-                    active = page === that.options.formatAllRows() ? ' class="active"' : '';
-                } else {
-                    active = page === that.options.pageSize ? ' class="active"' : '';
+            $.each(pageList, function (i, page) {
+                if (!that.options.smartDisplay || i === 0 || pageList[i - 1] <= that.options.totalRows) {
+                    var active;
+                    if ($allSelected) {
+                        active = page === that.options.formatAllRows() ? ' class="active"' : '';
+                    } else {
+                        active = page === that.options.pageSize ? ' class="active"' : '';
+                    }
+                    pageNumber.push(sprintf('<li%s><a href="javascript:void(0)">%s</a></li>', active, page));
                 }
-                pageNumber.push(sprintf('<li%s><a href="javascript:void(0)">%s</a></li>', active, page));
-            }
-        });
-        pageNumber.push('</ul></span>');
+            });
+            pageNumber.push('</ul></span>');
 
-        html.push(this.options.formatRecordsPerPage(pageNumber.join('')));
-        html.push('</span>');
+            html.push(this.options.formatRecordsPerPage(pageNumber.join('')));
+            html.push('</span>');
 
-        html.push('</div>',
-            '<div class="pull-' + this.options.paginationHAlign + ' pagination">',
-            '<ul class="pagination' + (this.options.iconSize === undefined ? '' : ' pagination-' + this.options.iconSize) + '">',
-            '<li class="page-first"><a href="javascript:void(0)">' + this.options.paginationFirstText + '</a></li>',
-            '<li class="page-pre"><a href="javascript:void(0)">' + this.options.paginationPreText + '</a></li>');
+            html.push('</div>',
+                '<div class="pull-' + this.options.paginationHAlign + ' pagination">',
+                '<ul class="pagination' + sprintf(' pagination-%s', this.options.iconSize) + '">',
+                '<li class="page-first"><a href="javascript:void(0)">' + this.options.paginationFirstText + '</a></li>',
+                '<li class="page-pre"><a href="javascript:void(0)">' + this.options.paginationPreText + '</a></li>');
 
-        if (this.totalPages < 5) {
-            from = 1;
-            to = this.totalPages;
-        } else {
-            from = this.options.pageNumber - 2;
-            to = from + 4;
-            if (from < 1) {
+            if (this.totalPages < 5) {
                 from = 1;
-                to = 5;
-            }
-            if (to > this.totalPages) {
                 to = this.totalPages;
-                from = to - 4;
+            } else {
+                from = this.options.pageNumber - 2;
+                to = from + 4;
+                if (from < 1) {
+                    from = 1;
+                    to = 5;
+                }
+                if (to > this.totalPages) {
+                    to = this.totalPages;
+                    from = to - 4;
+                }
+            }
+            for (i = from; i <= to; i++) {
+                html.push('<li class="page-number' + (i === this.options.pageNumber ? ' active' : '') + '">',
+                    '<a href="javascript:void(0)">', i, '</a>',
+                    '</li>');
             }
-        }
-        for (i = from; i <= to; i++) {
-            html.push('<li class="page-number' + (i === this.options.pageNumber ? ' active' : '') + '">',
-                '<a href="javascript:void(0)">', i, '</a>',
-                '</li>');
-        }
 
-        html.push(
-            '<li class="page-next"><a href="javascript:void(0)">' + this.options.paginationNextText + '</a></li>',
-            '<li class="page-last"><a href="javascript:void(0)">' + this.options.paginationLastText + '</a></li>',
-            '</ul>',
-            '</div>');
+            html.push(
+                '<li class="page-next"><a href="javascript:void(0)">' + this.options.paginationNextText + '</a></li>',
+                '<li class="page-last"><a href="javascript:void(0)">' + this.options.paginationLastText + '</a></li>',
+                '</ul>',
+                '</div>');
 
+        }
         this.$pagination.html(html.join(''));
 
-        $pageList = this.$pagination.find('.page-list a');
-        $first = this.$pagination.find('.page-first');
-        $pre = this.$pagination.find('.page-pre');
-        $next = this.$pagination.find('.page-next');
-        $last = this.$pagination.find('.page-last');
-        $number = this.$pagination.find('.page-number');
+        if (!this.options.onlyInfoPagination) {
+            $pageList = this.$pagination.find('.page-list a');
+            $first = this.$pagination.find('.page-first');
+            $pre = this.$pagination.find('.page-pre');
+            $next = this.$pagination.find('.page-next');
+            $last = this.$pagination.find('.page-last');
+            $number = this.$pagination.find('.page-number');
+
+            if (this.options.pageNumber <= 1) {
+                $first.addClass('disabled');
+                $pre.addClass('disabled');
+            }
+            if (this.options.pageNumber >= this.totalPages) {
+                $next.addClass('disabled');
+                $last.addClass('disabled');
+            }
+            if (this.options.smartDisplay) {
+                if (this.totalPages <= 1) {
+                    this.$pagination.find('div.pagination').hide();
+                }
+                if (pageList.length < 2 || this.options.totalRows <= pageList[0]) {
+                    this.$pagination.find('span.page-list').hide();
+                }
 
-        if (this.options.pageNumber <= 1) {
-            $first.addClass('disabled');
-            $pre.addClass('disabled');
-        }
-        if (this.options.pageNumber >= this.totalPages) {
-            $next.addClass('disabled');
-            $last.addClass('disabled');
-        }
-        if (this.options.smartDisplay) {
-            if (this.totalPages <= 1) {
-                this.$pagination.find('div.pagination').hide();
+                // when data is empty, hide the pagination
+                this.$pagination[this.getData().length ? 'show' : 'hide']();
             }
-            if (pageList.length < 2 || this.options.totalRows <= pageList[0]) {
-                this.$pagination.find('span.page-list').hide();
+            if ($allSelected) {
+                this.options.pageSize = this.options.formatAllRows();
             }
-
-            // when data is empty, hide the pagination
-            this.$pagination[this.getData().length ? 'show' : 'hide']();
+            $pageList.off('click').on('click', $.proxy(this.onPageListChange, this));
+            $first.off('click').on('click', $.proxy(this.onPageFirst, this));
+            $pre.off('click').on('click', $.proxy(this.onPagePre, this));
+            $next.off('click').on('click', $.proxy(this.onPageNext, this));
+            $last.off('click').on('click', $.proxy(this.onPageLast, this));
+            $number.off('click').on('click', $.proxy(this.onPageNumber, this));
         }
-        if ($allSelected) {
-            this.options.pageSize = this.options.formatAllRows();
-        }
-        $pageList.off('click').on('click', $.proxy(this.onPageListChange, this));
-        $first.off('click').on('click', $.proxy(this.onPageFirst, this));
-        $pre.off('click').on('click', $.proxy(this.onPagePre, this));
-        $next.off('click').on('click', $.proxy(this.onPageNext, this));
-        $last.off('click').on('click', $.proxy(this.onPageLast, this));
-        $number.off('click').on('click', $.proxy(this.onPageNumber, this));
     };
 
     BootstrapTable.prototype.updatePagination = function (event) {
@@ -1523,7 +1545,8 @@
 
                     // Hide empty data on Card view when smartDisplay is set to true.
                     if (that.options.cardView && that.options.smartDisplay && value === '') {
-                        text = '';
+                        // Should set a placeholder for event binding correct fieldIndex
+                        text = '<div class="card-view"></div>';
                     }
                 }
 
@@ -1642,7 +1665,7 @@
             }
 
             for (var key in events) {
-                that.$body.find('>tr').each(function () {
+                that.$body.find('>tr:not(.no-records-found)').each(function () {
                     var $tr = $(this),
                         $td = $tr.find(that.options.cardView ? '.card-view' : 'td').eq(fieldIndex),
                         index = key.indexOf(' '),
@@ -2148,26 +2171,30 @@
         var uniqueId = this.options.uniqueId,
             len = this.options.data.length,
             dataRow = null,
-            i, row;
+            i, row, rowUniqueId;
 
         for (i = len - 1; i >= 0; i--) {
             row = this.options.data[i];
 
-            if (!row.hasOwnProperty(uniqueId)) {
+            if (row.hasOwnProperty(uniqueId)) { // uniqueId is a column
+                rowUniqueId = row[uniqueId];
+            } else if(row._data.hasOwnProperty(uniqueId)) { // uniqueId is a row data property
+                rowUniqueId = row._data[uniqueId];
+            } else {
                 continue;
             }
 
-            if (typeof row[uniqueId] === 'string') {
+            if (typeof rowUniqueId === 'string') {
                 id = id.toString();
-            } else if (typeof row[uniqueId] === 'number') {
-                if ((Number(row[uniqueId]) === row[uniqueId]) && (row[uniqueId] % 1 === 0)) {
+            } else if (typeof rowUniqueId === 'number') {
+                if ((Number(rowUniqueId) === rowUniqueId) && (rowUniqueId % 1 === 0)) {
                     id = parseInt(id);
-                } else if ((row[uniqueId] === Number(row[uniqueId])) && (row[uniqueId] !== 0)) {
+                } else if ((rowUniqueId === Number(rowUniqueId)) && (rowUniqueId !== 0)) {
                     id = parseFloat(id);
                 }
             }
 
-            if (row[uniqueId] === id) {
+            if (rowUniqueId === id) {
                 dataRow = row;
                 break;
             }
@@ -2193,6 +2220,24 @@
         this.initBody(true);
     };
 
+    BootstrapTable.prototype.updateByUniqueId = function (params) {
+        var rowId;
+
+        if (!params.hasOwnProperty('id') || !params.hasOwnProperty('row')) {
+            return;
+        }
+
+        rowId = $.inArray(this.getRowByUniqueId(params.id), this.options.data);
+
+        if (rowId === -1) {
+            return;
+        }
+
+        $.extend(this.data[rowId], params.row);
+        this.initSort();
+        this.initBody(true);
+    };
+
     BootstrapTable.prototype.insertRow = function (params) {
         if (!params.hasOwnProperty('index') || !params.hasOwnProperty('row')) {
             return;
@@ -2328,10 +2373,10 @@
     };
 
     BootstrapTable.prototype.check_ = function (checked, index) {
-        this.$selectItem.filter(sprintf('[data-index="%s"]', index)).prop('checked', checked);
+        var $el = this.$selectItem.filter(sprintf('[data-index="%s"]', index)).prop('checked', checked);
         this.data[index][this.header.stateField] = checked;
         this.updateSelected();
-        this.trigger(checked ? 'check' : 'uncheck', this.data[index]);
+        this.trigger(checked ? 'check' : 'uncheck', this.data[index], $el);
     };
 
     BootstrapTable.prototype.checkBy = function (obj) {
@@ -2354,11 +2399,11 @@
                 return false;
             }
             if ($.inArray(row[obj.field], obj.values) !== -1) {
-                that.$selectItem.filter(':enabled')
+                var $el = that.$selectItem.filter(':enabled')
                     .filter(sprintf('[data-index="%s"]', index)).prop('checked', checked);
                 row[that.header.stateField] = checked;
                 rows.push(row);
-                that.trigger(checked ? 'check' : 'uncheck', row);
+                that.trigger(checked ? 'check' : 'uncheck', row, $el);
             }
         });
         this.updateSelected();
@@ -2566,7 +2611,7 @@
         'getOptions',
         'getSelections', 'getAllSelections', 'getData',
         'load', 'append', 'prepend', 'remove', 'removeAll',
-        'insertRow', 'updateRow', 'updateCell', 'removeByUniqueId',
+        'insertRow', 'updateRow', 'updateCell', 'updateByUniqueId', 'removeByUniqueId',
         'getRowByUniqueId', 'showRow', 'hideRow', 'getRowsHidden',
         'mergeCells',
         'checkAll', 'uncheckAll',

+ 3 - 3
src/extensions/cookie/bootstrap-table-cookie.js

@@ -244,9 +244,9 @@
             searchTextCookie = getCookie(this, this.options.cookieIdTable, cookieIds.searchText);
 
         //sortOrder
-        this.options.sortOrder = sortOrderCookie ? sortOrderCookie : 'asc';
+        this.options.sortOrder = sortOrderCookie ? sortOrderCookie : this.options.sortOrder;
         //sortName
-        this.options.sortName = sortOrderNameCookie ? sortOrderNameCookie : undefined;
+        this.options.sortName = sortOrderNameCookie ? sortOrderNameCookie : this.options.sortName;
         //pageNumber
         this.options.pageNumber = pageNumberCookie ? +pageNumberCookie : this.options.pageNumber;
         //pageSize
@@ -313,7 +313,7 @@
     
     BootstrapTable.prototype.selectPage = function (page) {
         _selectPage.apply(this, Array.prototype.slice.apply(arguments));
-        setCookie(this, idsStateSaveList.pageNumber, page);
+        setCookie(this, cookieIds.pageNumber, page);
     };
 
     BootstrapTable.prototype.onSearch = function () {

+ 4 - 5
src/extensions/export/bootstrap-table-export.js

@@ -14,8 +14,8 @@
         txt: 'TXT',
         sql: 'SQL',
         doc: 'MS-Word',
-        excel: 'Ms-Excel',
-        powerpoint: 'Ms-Powerpoint',
+        excel: 'MS-Excel',
+        powerpoint: 'MS-Powerpoint',
         pdf: 'PDF'
     };
 
@@ -83,12 +83,11 @@
                         };
 
                     if (that.options.exportDataType === 'all' && that.options.pagination) {
-                        that.togglePagination();
-                        that.$el.on('load-success.bs.table', function () {
+                        that.$el.one('load-success.bs.table page-change.bs.table', function () {
                             doExport();
-                            that.$el.off('load-success.bs.table');
                             that.togglePagination();
                         });
+                        that.togglePagination();
                     } else if (that.options.exportDataType === 'selected') {
                         var data = that.getData(),
                             selectedData = that.getAllSelections();

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

@@ -22,7 +22,9 @@
 
     var resetView = function (that) {
         if (that.options.height || that.options.showFooter) {
-            setTimeout(that.resetView, 1);
+            setTimeout(function(){
+                that.resetView.call(that);
+            }, 1);
         }
     };
 

+ 5 - 4
src/locale/bootstrap-table-it-IT.js

@@ -1,6 +1,7 @@
 /**
  * Bootstrap Table Italian translation
  * Author: Davide Renzi<davide.renzi@gmail.com>
+ * Author: Davide Borsatto <davide.borsatto@gmail.com>
  */
 (function ($) {
     'use strict';
@@ -10,7 +11,7 @@
             return 'Caricamento in corso...';
         },
         formatRecordsPerPage: function (pageNumber) {
-            return pageNumber + ' records per pagina';
+            return pageNumber + ' elementi per pagina';
         },
         formatShowingRows: function (pageFrom, pageTo, totalRows) {
             return 'Pagina ' + pageFrom + ' di ' + pageTo + ' (' + totalRows + ' records)';
@@ -19,13 +20,13 @@
             return 'Cerca';
         },
         formatNoMatches: function () {
-            return 'Nessun record trovato';
+            return 'Nessun elemento trovato';
         },
         formatRefresh: function () {
-            return 'Rinfrescare';
+            return 'Aggiorna';
         },
         formatToggle: function () {
-            return 'Alternare';
+            return 'Alterna';
         },
         formatColumns: function () {
             return 'Colonne';

+ 3 - 0
src/locale/bootstrap-table-ja-JP.js

@@ -32,6 +32,9 @@
         },
         formatColumns: function () {
             return '列';
+        },
+        formatAllRows: function () {
+            return 'すべて';
         }
     };
 

+ 3 - 0
src/locale/bootstrap-table-ms-MY.js

@@ -32,6 +32,9 @@
         },
         formatColumns: function () {
             return 'Lajur';
+        },
+        formatAllRows: function () {
+            return 'Semua';
         }
     };