ソースを参照

Merge pull request #55 from wenzhixin/master

Update my repo
Dennis Hernández 10 年 前
コミット
3711e40a11

+ 7 - 1
docs/_i18n/en/extensions/filter-control.md

@@ -1,6 +1,7 @@
 # Table Filter Control
 
 Use Plugin: [bootstrap-table-filter-control](https://github.com/wenzhixin/bootstrap-table/tree/master/src/extensions/filter-control)
+Dependence if you use the datepicker option: [bootstrap-datepicker](https://github.com/eternicode/bootstrap-datepicker) v1.4.0
 
 ## Usage
 
@@ -21,7 +22,12 @@ Use Plugin: [bootstrap-table-filter-control](https://github.com/wenzhixin/bootst
 ### filterControl
 
 * type: String
-* description: Set `input` or `select` to add one of those element into column.
+* description: Set `input`: show an input control, `select`: show a select control, 'datepicker': show a datepicker control.
+* default: `undefined`
+
+### filterDatepickerOptions
+* type: Object
+* description: If the datepicker option is set use this option to configure the datepicker with the native options. Use this way: `data-filter-datepicker-options='{"autoclose":true, "clearBtn": true, "todayHighlight": true}'`.
 * default: `undefined`
 
 ## Events

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

@@ -1,6 +1,7 @@
 # Table Filter Control
 
 Use Plugin: [bootstrap-table-filter-control](https://github.com/wenzhixin/bootstrap-table/tree/master/src/extensions/filter-control)
+Dependence if you use the datepicker option: [bootstrap-datepicker](https://github.com/eternicode/bootstrap-datepicker) v1.4.0
 
 ## Usage
 
@@ -21,7 +22,12 @@ Use Plugin: [bootstrap-table-filter-control](https://github.com/wenzhixin/bootst
 ### filterControl
 
 * type: String
-* description: Set `input` or `select` to add one of those element into column.
+* description: Set `input`: show an input control, `select`: show a select control, 'datepicker': show a datepicker control.
+* default: `undefined`
+
+### filterDatepickerOptions
+* type: Object
+* description: If the datepicker option is set use this option to configure the datepicker with the native options. Use this way: `data-filter-datepicker-options='{"autoclose":true, "clearBtn": true, "todayHighlight": true}'`.
 * default: `undefined`
 
 ## Events

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

@@ -1,6 +1,7 @@
 # Table Filter Control
 
 Use Plugin: [bootstrap-table-filter-control](https://github.com/wenzhixin/bootstrap-table/tree/master/src/extensions/filter-control)
+Dependence if you use the datepicker option: [bootstrap-datepicker](https://github.com/eternicode/bootstrap-datepicker) v1.4.0
 
 ## Usage
 
@@ -21,7 +22,12 @@ Use Plugin: [bootstrap-table-filter-control](https://github.com/wenzhixin/bootst
 ### filterControl
 
 * type: String
-* description: Set `input` or `select` to add one of those element into column.
+* description: Set `input`: show an input control, `select`: show a select control, 'datepicker': show a datepicker control.
+* default: `undefined`
+
+### filterDatepickerOptions
+* type: Object
+* description: If the datepicker option is set use this option to configure the datepicker with the native options. Use this way: `data-filter-datepicker-options='{"autoclose":true, "clearBtn": true, "todayHighlight": true}'`.
 * default: `undefined`
 
 ## Events

+ 4 - 3
src/bootstrap-table.js

@@ -1428,7 +1428,7 @@
         }
 
         // click to select by column
-        this.$body.find('> tr > td').off('click').on('click', function () {
+        this.$body.find('> tr[data-index] > td').off('click').on('click', function () {
             var $td = $(this),
                 $tr = $td.parent(),
                 item = that.data[$tr.data('index')],
@@ -1436,6 +1436,7 @@
                 $headerCell = that.$header.find('th:eq(' + cellIndex + ')'),
                 field = $headerCell.data('field'),
                 value = item[field];
+
             that.trigger('click-cell', field, value, item, $td);
             that.trigger('click-row', item, $tr);
             // if click to select - then trigger the checkbox/radio click
@@ -1446,7 +1447,7 @@
                 }
             }
         });
-        this.$body.find('> tr > td').off('dblclick').on('dblclick', function () {
+        this.$body.find('> tr[data-index] > td').off('dblclick').on('dblclick', function () {
             var $td = $(this),
                 $tr = $td.parent(),
                 item = that.data[$tr.data('index')],
@@ -1458,7 +1459,7 @@
             that.trigger('dbl-click-row', item, $tr);
         });
 
-        this.$body.find('> tr > td > .detail-icon').off('click').on('click', function () {
+        this.$body.find('> tr[data-index] > td > .detail-icon').off('click').on('click', function () {
             var $this = $(this),
                 $tr = $this.parent().parent(),
                 index = $tr.data('index'),