Browse Source

Adding new event to filter-control

djhvscf 7 years ago
parent
commit
ba20cb4462

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

@@ -274,7 +274,7 @@
                 }
 
                 setCookie(that, cookieIds.filterControl, JSON.stringify(that.options.filterControls));
-            }).on('post-body.bs.table', initCookieFilters(that));
+            }).on('created-controls.bs.table', initCookieFilters(that));
         }
         _init.apply(this, Array.prototype.slice.apply(arguments));
     };

+ 4 - 0
src/extensions/filter-control/README.md

@@ -97,6 +97,10 @@ Dependence if you use the datepicker option: [bootstrap-datepicker](https://gith
 
 * Fired when we are searching into the column data
 
+### onCreatedControls(created-controls.bs.table)
+
+* Fired when we are searching into the column data
+
 ## Methods
 
 ### triggerSearch

+ 4 - 1
src/extensions/filter-control/bootstrap-table-filter-control.js

@@ -376,6 +376,8 @@
         } else {
             header.find('.filterControl').hide();
         }
+
+        this.trigger('created-controls');
     };
 
     var getDirectionOfSelectOptions = function (alignment) {
@@ -468,7 +470,8 @@
     });
 
     $.extend($.fn.bootstrapTable.Constructor.EVENTS, {
-        'column-search.bs.table': 'onColumnSearch'
+        'column-search.bs.table': 'onColumnSearch',
+        'created-controls.bs.table': 'onCreatedControls'
     });
 
     $.extend($.fn.bootstrapTable.defaults.icons, {