浏览代码

Update examples.html

Added comments explaining the use of data-method to utilize one handler for multiple function calls.
cokert 11 年之前
父节点
当前提交
43f2485083
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      docs/examples.html

+ 3 - 0
docs/examples.html

@@ -937,6 +937,9 @@
                                 $('#get-data').click(function () {
                                     alert('current data: ' + JSON.stringify($table.bootstrapTable('getData')));
                                 });
+                                // This demonstrates utilizing the data-method attribute to use one jQuery handler to execute multiple methods 
+                                // ($this).data('method') retrieves the value of the data-method attribute of the object that was clicked
+                                // which is then passed to the bootstrapTable function. Only the load and append methods require a parameter                                 
                                 $('#load-data, #append-data, #check-all, #uncheck-all, ' +
                                         '#show-loading, #hide-loading').click(function () {
                                     $table.bootstrapTable($(this).data('method'), getRows());